xml-xalan-j-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Devlin, Kurt" <Kurt.Dev...@westgroup.com>
Subject cdata-section-elements strangeness
Date Wed, 14 Aug 2002 19:58:23 GMT
A co-worker has come across some strangeness with generating CDATA wrappers
around some elements (see sample below). Basically, two wrappers are being
generated with Xalan, where Saxon only generates one. Are there any ill
effects due to this double wrapper (more than being visually unappealing)?
Is there a reason Xalan does it this way?

Thanks,
Kurt

<!-- Input -->
<root>
	<one>1234</one>
	<two>ABCD</two>
</root>

<!-- XSL -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" cdata-section-elements="combined" />
	
	<xsl:template match="/">
		<xsl:apply-templates />
	</xsl:template>
	
	<xsl:template match="root">
		<combined>
			<xsl:value-of select="one" />
			<xsl:value-of select="two" />
		</combined>
	</xsl:template>
</xsl:stylesheet>

<!-- Desired Output (and Saxon Output) -->
<combined><![CDATA[1234ABCD]]></combined>

<!-- Xalan Output -->
<combined><![CDATA[1234]]><![CDATA[ABCD]]></combined>

Mime
View raw message