cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobia Conforto <>
Subject document() and xsltc
Date Wed, 07 Nov 2007 11:31:56 GMT
I think I stumbled upon a bug in the XSLTC transfomer regarding the
document() function.  Here is a minimal example:

--- sitemap fragment: --------------------------------------

<match pattern="test">
  <generate src="foo.xml"/>
  <transform src="foo-bar.xsl" type="xsltc"/>
  <serialize type="xml"/>

--- foo.xml: -----------------------------------------------


--- bar.xml: -----------------------------------------------


--- foo-bar.xsl: -------------------------------------------

<xsl:stylesheet version="1.0" xmlns:xsl="">

  <xsl:variable name="foo" select="/"/>
  <xsl:variable name="bar" select="document('bar.xml')"/>

  <xsl:template match="/">
      <foo><xsl:value-of select="name($foo/*)"/></foo>
      <bar><xsl:value-of select="name($bar/*)"/></bar>



The output I would expect, which is also the output I get using the
default xslt (Xalan-J interpretive) transformer is:


But if I use the xsltc (Xalan-J compiled) transformer the output is:


It would appear that the document() call overwrites the source document
of the transformation, including all existing references to it.

Is this a known bug?  Can anybody confirm/reproduce it?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message