I’m writing an XSLT transformation (for XSL-FO), and need to repeat something for each letter in a string value, for example:
If string is stored in MyData/MyValue string (e.g. MyData.MyValue = “something”), I need an for-each like this one:
<xsl:for-each select="MyData/MyValue"> <!-- What goes here to iterate through letters? -->
<someTags>
<xsl:value-of select="Letter" /> <!-- What goes here to output current letter? -->
</someTags>
</xsl:for-each>
Any ideas?
you could use a call template and pass parameters, then use recursion to call the template untill there are no characters left.
example added below.
on this xml
and this xslt
you will then be able to manipulate in the if statement to do further stuff!