Find index of matches in xsl:analyze-string?
Posted: Fri Oct 04, 2013 8:02 pm
I am using xsl:analyze-stirng to prse a long string and break it into separate lines that are under a given length.
Example input
I already have working code that gives me this:
... where the 10 character string is the result of xsl:nonmatching-substring.
What I need to get is this:
...where the position value corresponds to the index of the substring (i.e., the first matching substring is 1, the next is 2, and so on).
Need this soon, so ideas appreciated!!!
Example input
Code: Select all
<root>
<string>210 character string</string>
</root>
Code: Select all
<root>
<string>50 character string</string>
<string>50 character string</string>
<string>50 character string</string>
<string>50 character string</string>
<string>10 character string</string>
</root>
What I need to get is this:
Code: Select all
<root>
<string position="1">50 character string</string>
<string position="2">50 character string</string>
<string position="3">50 character string</string>
<string position="4">50 character string</string>
<string position="5">10 character string</string>
</root>
Need this soon, so ideas appreciated!!!