You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/12/09 16:08:16 UTC
DO NOT REPLY [Bug 15179] New: -
Testcase in error, CDATA sections for xml output
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15179>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15179
Testcase in error, CDATA sections for xml output
Summary: Testcase in error, CDATA sections for xml output
Product: XalanJ2
Version: CurrentCVS
Platform: Other
OS/Version: Windows NT/2K
Status: NEW
Severity: Normal
Priority: Other
Component: Xalan
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: minchau@ca.ibm.com
Testcase output46 has a "gold" file that has output text elements wrapped in
CDATA.
I've compared with SAXON, and Xalan's gold file is wrong.
output46.xsl has this:
<xsl:output cdata-section-elements="test"/>
<xsl:output method="html" doctype-public="-//W3C//DTD HTML 4.0
Transitional" cdata-section-elements="example"/>
Its output has both elements, "test" and "example" put out as CDATA. However
SAXON does not do this, and the XSLT 1.0 says this under section 16:
>> If the semantics of an attribute are not described
>> for an output method,
>> then it is not applicable to that output method.
In section 16.2 the cdata-section-elements attribute is not mentioned under
HTML output, so I must assume that it is not applicable.
With SAXON the result is:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional">
<example><foo></example>
<test>]]></test>
but Xalan gives:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional">
<example><![CDATA[<foo>]]></example>
<test><![CDATA[]]]]><![CDATA[>]]></test>
Comments in output46.xsl indicate that it expects both elements to be ouput as
CDATA but the gold file is wrong according to XSLT 1.0.
The simplest fix seems to me to not push or pop any values on the stack
m_cdataSectionStates for HTML output. This stack keeps track of whether the
current element was listed in the cdata-section-elements or not.
I'd suggest keeping the existing testcase, but changing method="html" to
method="xml" in the stylesheet. An addition testcase should be written to test
that cdata-section-elements attribute is ignored for method="html".
- Brian Minchau, IBM