You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Carlo Marchiori (JIRA)" <xa...@xml.apache.org> on 2004/11/15 15:08:28 UTC

[jira] Commented: (XALANJ-1546) XSLTC: top-level xsl:variable with document() breaks

     [ http://nagoya.apache.org/jira/browse/XALANJ-1546?page=comments#action_55494 ]
     
Carlo Marchiori commented on XALANJ-1546:
-----------------------------------------

Hi,

I've just an attachment (xalan-bug20381-usecase.zip) showing a usecase and a proposed fix. 

The problem is due to the fact that the main document and the included document are loaded using two separate dtm managers, so that eventually there is a collision between document ids. So the proposed fix forces only one dtm manager to be used.

The problem shows up only if both of these holds

1) you use a TransformerHandler, namely doing transformations the sax way, as Cocoon does, for example

2) you set a custom URIResolver to the associated Transformer object. In this way the transformer uses a dom cache, otherwise it doesn't.

Carlo.

> XSLTC: top-level xsl:variable with document() breaks
> ----------------------------------------------------
>
>          Key: XALANJ-1546
>          URL: http://nagoya.apache.org/jira/browse/XALANJ-1546
>      Project: XalanJ2
>         Type: Bug
>   Components: XSLTC
>     Versions: 2.5
>  Environment: Operating System: Linux
> Platform: Other
>     Reporter: Jeff Turner
>     Assignee: Xalan Developers Mailing List
>  Attachments: DocumentTest.java, document.xml, other.xml, stylesheet.xsl, xalan-bug20381-usecase.zip, xsltcbug2.tgz
>
> Hi,
> Seems that XSLTC doesn't like using document() in a top-level element:
> <xsl:variable name="config" select="document('skinconf.xml')"/>
> This has the effect of *importing* skinconf.xml nodes. If I then have a
> copy-across rule:
>   <xsl:template match="node()|@*" priority="-1">
>     <xsl:copy>
>       <xsl:apply-templates select="@*"/>
>       <xsl:apply-templates/>
>     </xsl:copy>
>   </xsl:template>
> Then skinconf.xml element bodies appear in the output.
> This bug does not show when using regular Xalan, nor does it show up when using
> XSLTC from the command-line. It seems to have something to do with the
> document() function.
> Attached is a sample subsitemap which demonstrates the bug. It can be unpacked
> directly into build/webapp/. A script for testing command-line XSLTC is also
> provided.
> --Jeff

-- 
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: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org