cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobia Conforto <tobia.confo...@linux.it>
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"/>
</match>

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

<foo/>

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

<bar/>

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

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

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

</xsl:stylesheet>

------------------------------------------------------------


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

<output>
  <foo>foo</foo>
  <bar>bar</bar>
</output>

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

<output>
  <foo>bar</foo>
  <bar>bar</bar>
</output>

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?


Tobia

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message