GNOME Bugzilla – Bug 339570
Computation of cdata-section-elements in conjunction with the default namespace
Last modified: 2006-05-11 14:24:39 UTC
In xsltParseStylesheetOutput(), "cdata-section-elements": A QName which expanded using the default namespace, is incorrectly added twice to the hash: once with no namespace and once with the default namespace; thus the serialization will generate CDATA-sections for: 1) elements with the specified local-name in *no* namespace 2) elements with the specified local-name in the default namespace Example: "cdata-2.xsl" <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="urn:test:foo" xmlns:foo="urn:test:foo"> <xsl:output cdata-section-elements="foo"/> <xsl:template match="/" xmlns=""> <foo>foo<foo:foo>zoo</foo:foo></foo> </xsl:template> </xsl:stylesheet> xsltproc cdata-2.xsl cdata-2.xml <?xml version="1.0"?> <foo xmlns="" xmlns:foo="urn:test:foo"><![CDATA[foo]]><foo:foo><![CDATA[zoo]]></foo:foo></foo> Expected result: <?xml version="1.0"?> <foo xmlns:foo="urn:test:foo">foo<foo:foo><![CDATA[zoo]]></foo:foo></foo>
Fixed in CVS, xslt.c, revision 1.127. We now the the expected result as shown above.