You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Thomas Foerster <y0...@tu-bs.de> on 2001/01/10 11:59:05 UTC
Different behavior between Xalan-C++ and Xalan-J?
Hi!
I have some CDATA-sections in an xml-document that contain not
well-formed HTML:
<?xml version="1.0"?>
<element>
<![CDATA[ This <br> is not <p> well-formed. ]]>
</element>
A XSL-stylesheet is used to transform the data to a
HTML-page. I use the "disable-output-escaping"-attribute to get the
verbatim content of this element:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html><body>
<xsl:apply-templates />
</body></html>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of disable-output-escaping="yes" select="." />
</xsl:template>
</xsl:stylesheet>
Everything works perfectly well with the Xalan-C++ processor, but the
Java-version does not disable the output-escaping. I get:
<html>
<body>
This <br> is not <p> well-formed.
</body>
</html>
Or (with a set "-html" command-line option):
<html>
<body><![CDATA[
This <br> is not <p> well-formed.
]]>
</body>
</html>
But I want the following:
<html>
<body>
This <br> is not <p> well-formed.
</body>
</html>
which is produced by Xalan-C++.
If I change the stylesheet and call
<xsl:value-of disable-output-escaping="yes" select="."/>
directly in the root-template instead of using an altered default-text()
template, even Java-Xalan produces the correct result. But this doesn't
help me much, because I want to take "apply-templates" since I use the
CDATA-sections in mixed-content elements.
Is this a bug? Is there any other way to output
not-wellformed data with XSL in Java-Xalan?
Thomas
BTW:
The version of Java-Xalan is: Xalan Version 2.0_D05
The version of C++-Xalan is: TestXSLT version 1.0.0 (Xalan C++ version 1.0.0)