[ http://nagoya.apache.org/jira/browse/XALANJ-1761?page=history ]
Santiago Pericas-Geertsen resolved XALANJ-1761:
-----------------------------------------------
Assign To: Santiago Pericas-Geertsen (was: Xalan Developers Mailing List)
Resolution: Fixed
Fix Version: CurrentCVS
Multiple instances of xsl:output instructions are now correctly merged as
defined by the XSLT spec.
> XSLTC does not merge xsl:output attributes properly
> ---------------------------------------------------
>
> Key: XALANJ-1761
> URL: http://nagoya.apache.org/jira/browse/XALANJ-1761
> Project: XalanJ2
> Type: Bug
> Components: Xalan-interpretive, transformation
> Versions: CurrentCVS
> Environment: Operating System: Other
> Platform: Other
> Reporter: Brian Minchau
> Assignee: Santiago Pericas-Geertsen
> Fix For: CurrentCVS
>
> Quoting the XSLT 1.0 recommendation, section 16 (just before 16.1) :
> <<A stylesheet may contain multiple xsl:output elements and may include or
> import stylesheets that also contain xsl:output elements. All the xsl:output
> elements occurring in a stylesheet are merged into a single effective
> xsl:output element. For the cdata-section-elements attribute, the effective
> value is the union of the specified values.>>
> The following testcase:
> -----------------------------------------
> <?xml version="1.0"?>
> <xsl:stylesheet
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
> xmlns:prfx1="http://buyit.com">
> <xsl:output
> method="text"
> indent="yes"
> encoding="US-ASCII"
> omit-xml-declaration="yes"
> cdata-section-elements="prfx1:cdata1" />
> <xsl:output
> method="xml"
> cdata-section-elements="prfx1:cdata2"
> omit-xml-declaration="no" />
> <xsl:template match="/">
> <output>
> <prfx1:cdata1>This should be a cdata section and the output method should be
> xml, and indented</prfx1:cdata1>
> <prfx1:cdata2>This should be a cdata section and the xml header should be
> present too</prfx1:cdata2>
> </output>
> </xsl:template>
> </xsl:stylesheet>
> -----------------------------------------
> Produces this for Xalan-J interpretive:
> ---------------------------------------
> <?xml version="1.0" encoding="US-ASCII"?>
> <output xmlns:prfx1="http://buyit.com">
> <prfx1:cdata1><![CDATA[This should be a cdata section and the output method
> should be xml, and indented]]></prfx1:cdata1>
> <prfx1:cdata2><![CDATA[This should be a cdata section and the xml header
> should
> be present too]]></prfx1:cdata2>
> </output>
> ---------------------------------------
> So Xalan-J clearly merges the elements as its output method is "xml", it is
> indented but its encoding is "US-ASCII".
> On the other hand, XSLTC produces this:
> ----------------------------------------
> <?xml version="1.0" encoding="UTF-8"?>
> <output xmlns:prfx1="http://buyit.com"><prfx1:cdata1><![CDATA[This should be
> a
> cdata section and the output method should be xml, and indented]]
> ></prfx1:cdata1><prfx1:cdata2><![CDATA[This should be a cdata section and the
> xml header should be present too]]></prfx1:cdata2></output>
> ----------------------------------------
> XSLTC has lost all information from the first xsl:output element except for
> the
> cdata cdata-section-elements lists.
> XSLTC needs to merge xsl:output attributes into one effective xsl:output
> element. Both Xalan-J and XSLTC do not report the error that there are more
> than one value for an xsl:output attribute (other than
> cdata-section-elements)
> and they take the specified recovery of using the last value specified in the
> stylesheet.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]