Richard Rowell wrote:
On Fri, 2004-10-08 at 15:56, [EMAIL PROTECTED] wrote:

Hi Richard,

This does look like a bug in Xalan-J. However, you can avoid using the node-set extension function, if modify your stylesheet: slightly:

<snipped for brevity>

It might help you as a workaround for the problem, and is also more portable than relying on an extension function.


I made the change you suggested, but my test case behaves the same as
before.  Perhaps the problem is deeper then just the nodeset()
extension?


I'm having problems when using the nodeset() function as well. I'm not sure if it's related or if I've just missed something basic but I'll explain it anyway:

*** here is my xml document:

<root>
        <foo>
                <bar id="1"/>
                <bar id="2"/>
                <bar id="3"/>
        </foo>
</root>




*** and here is my xslt script:

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

        <xsl:output method="html"/>

<xsl:template match="/">
<xsl:message>correct: <xsl:for-each select="/root/foo/bar">found! </xsl:for-each></xsl:message>


<xsl:variable name="result-tree-fragment">
<xsl:for-each select="/root/foo/bar">
<bar id="[EMAIL PROTECTED]"/>
</xsl:for-each>
</xsl:variable>

<xsl:for-each select="/root/foo">
<xsl:message>still correct: <xsl:for-each select="/root/foo/bar">found! </xsl:for-each></xsl:message>
</xsl:for-each>

<xsl:for-each select="xalan:nodeset($result-tree-fragment)/bar">
<xsl:message>broken: <xsl:for-each select="/root/foo/bar">found!</xsl:for-each></xsl:message>
</xsl:for-each>
</xsl:template>


</xsl:stylesheet>




when parsed by xalan the output looks like this:

file:/home/test.xsl; Line #10; Column #-1; correct: found! found! found!
file:/home/test.xsl; Line #19; Column #-1; still correct: found! found! found!
file:/home/test.xsl; Line #23; Column #-1; broken:
file:/home/test.xsl; Line #23; Column #-1; broken:
file:/home/test.xsl; Line #23; Column #-1; broken:



I expected it to look like this:

file:/home/test.xsl; Line #10; Column #-1; correct: found! found! found!
file:/home/test.xsl; Line #19; Column #-1; still correct: found! found! found!
file:/home/test.xsl; Line #23; Column #-1; broken: found! found! found!
file:/home/test.xsl; Line #23; Column #-1; broken: found! found! found!
file:/home/test.xsl; Line #23; Column #-1; broken: found! found! found!



can anybody help?

Reply via email to