You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Brian Minchau (JIRA)" <xa...@xml.apache.org> on 2007/12/12 04:47:43 UTC

[jira] Closed: (XALANJ-1761) XSLTC does not merge xsl:output attributes properly

     [ https://issues.apache.org/jira/browse/XALANJ-1761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brian Minchau closed XALANJ-1761.
---------------------------------


closing this issue.

> XSLTC does not merge xsl:output attributes properly
> ---------------------------------------------------
>
>                 Key: XALANJ-1761
>                 URL: https://issues.apache.org/jira/browse/XALANJ-1761
>             Project: XalanJ2
>          Issue Type: Bug
>          Components: transformation, Xalan-interpretive
>    Affects Versions: 2.7.1
>         Environment: Operating System: Other
> Platform: Other
>            Reporter: Brian Minchau
>            Assignee: Santiago Pericas-Geertsen
>            Priority: Blocker
>             Fix For: 2.7.1
>
>
> 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.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org