When processing two consecutive elements in mixed content separated by
white-space, using text output in XSLT, the white-space gets lost.
This occurs using Saxon 6.5.2 under Red Hat 9: I haven't tested it with
anything else yet, but the sister stylesheet which output HTML keeps the
white-space as expected. Is this a bug or a feature of XSLT text-mode?
Minimal document:
<?xml version="1.0" encoding="iso-8859-1"?>
<para>Created using the <productname>DocBook</productname>
<acronym>DTD</acronym> on 2003-05-05.</para>
Note the newline and indent space (added by psgml) between DocBook
and DTD. Minimal stylesheet:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text" encoding="iso-8859-1"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:text>\documentclass{article}
</xsl:text>
<xsl:text>\begin{document}
</xsl:text>
<xsl:apply-templates/>
<xsl:text>\end{document}</xsl:text>
</xsl:template>
<xsl:template match="para">
<xsl:apply-templates/>
<xsl:text>

</xsl:text>
</xsl:template>
<xsl:template match="productname">
<xsl:text>\product{</xsl:text>
<xsl:apply-templates/>
<xsl:text>}</xsl:text>
</xsl:template>
<xsl:template match="acronym">
<xsl:text>\acro{</xsl:text>
<xsl:apply-templates/>
<xsl:text>}</xsl:text>
</xsl:template>
</xsl:stylesheet>
Output from Saxon:
\documentclass{article}
\begin{document}
Created using the \product{DocBook}\acro{DTD} on 2003-05-05.
\end{document}
This looks wrong: the white-space in mixed content should be honoured
between the productname element and the acronym element. Both nsgmls
and rxp retain the newline and space tokens. Or have I missed something
arcane in the XSLT spec?
///Peter
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list