Hi,
I write my xsl in xmlspy (version 2006 sp2) and use saxon 8804 to do
the transformation in java code.
I get the following discrepancy in the produced output, saxon seems to
produce extra white space.
I know that saxon is the more specification compliant of the two
processors, but xmlspy does what I want.
So I know that I am missing something fundamental here and I would be
grateful for some help.
The immediate question is, how do I get saxon to produce the output I
want, shown by the xmlspy output?
And secondly, what am I not understanding about whitespace handling in xsl?
Thank you for your attention.
Erwin
Here is my example code that demostrates the problem:
-- begin xml--
<?xml version="1.0" encoding="UTF-8"?>
<top>
<section name="AAA" />
<section name="BBB" />
</top>
-- end xml --
-- begin xsl --
?xml version="1.0" encoding="UTF-8"?>
<?altova_samplexml C:\workspaces\rad\garuda\storage\example.xml?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:fn="http://www.w3.org/2005/xpath-functions"
xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
<xsl:output method="text" version="1.0" encoding="iso-8859-1" />
<xsl:variable name="newline"><xsl:text> </xsl:text></xsl:variable>
<xsl:template match="/">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="//section" >
<xsl:call-template name="section-header" />
</xsl:template>
<xsl:template name="section-header" >
<xsl:value-of select="@name"/>
<xsl:value-of select="$newline"/>
</xsl:template>
</xsl:stylesheet>
-- end xsl --
-- begin xmlspy output --
AAA
BBB
-- end xmlspy output --
-- begin saxon output --
AAA
BBB
-- end saxon output -
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--