XSLT Strange behaviour of xsl:analyze-string//xsl:copy
If I apply the attached XSLT over the XML, the xsl:copy instruction generates a whitespace before each chunk of text, as:
<p>Z y t o lo g i e</p>
if I copy the text() by xsl:value-of, I'm getting the expected:
#1 Updated by Martin Honnen about 1 year ago
I think the result is in accordance with the XSLT spec, your
xsl:analyze-string with the
xsl:copy https://www.w3.org/TR/xslt-30/#shallow-copy constructs a sequence of
xs:string values (i.e. all the non-matching substrings) and if you look at https://www.w3.org/TR/xslt-30/#constructing-complex-content
Any consecutive sequence of strings in the sequence is converted to a single text node, whose string value contains the content of each of the strings in turn, with a single space (#x20) used as a separator between successive strings.
you will see that there is a space inserted between strings in a sequence.
Please register to edit this issue