XSLT expand-text="yes" causes extra whitespace in the output

Setting expand-text="yes" in an XSLT stylesheet appears to cause extra whitespace to be emitted in the output XML. For example, this stylesheet:

<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
    expand-text="no"
    version="3.0">
    <xsl:template match="/">
        <xsl:text>A</xsl:text>
        <xsl:text>B</xsl:text>
    </xsl:template>
</xsl:stylesheet>

produces the output AB. But if I change it to expand-text="yes" then it produces A B.

Can anyone help explain this behavior? Is it by design? I am using Saxon-PE 9.6.0.7.

Thanks, Josh.

Answers


Just for completeness: this was a bug in Saxon 9.6 that is fixed in 9.7.


Need Your Help

Delete duplicates based on multiple columns and sum one of the columns

vba excel-vba excel

I use this script, but this only checks for one column if the row is duplicate or not.

change a string in my xml code non programatically

android xml string

Hello I am wondering if there is a way to change a string value in my xml code without touching the .java file