|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Adding newline changes output formatting
I have XML input:
<?xml version="1.0"?>
<packages>
<package>
<category>Applications/Internet</category>
<install-name>test</install-name>
and want to duplicate this as output using the XSLT input:
<xsl:template match="/">
<xsl:element name="packages">
<xsl:for-each select="packages/package">
<xsl:element name="package">
<xsl:copy-of select="category"/>
<xsl:if test="string(category)">
<xsl:text> </xsl:text>
</xsl:if>
...
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:template>
Using xsltproc 1.0.23 I get:
<?xml version="1.0"?>
<packages>
<package><category>Applications/Internet</category>
</package>
</packages>
If I remove:
<xsl:if test="string(category)">
<xsl:text> </xsl:text>
</xsl:if>
I get:
<?xml version="1.0"?>
<packages>
<package>
<category>Applications/Internet</category>
</package>
</packages>
So why does inserting a newline mess up the output?
--
albert chin (china@xxxxxxxxxxxxxxxxxx)
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








