[xsl] xalan node-set not working

Subject: [xsl] xalan node-set not working
From: Paul Tremblay <phthenry@xxxxxxxxxxxxx>
Date: Sat, 28 Feb 2004 19:53:01 -0500
If I use xalan to process a stylesheet with a node-set, I get this

(Location of error unknown)XSLT Error (javax.xml.transform.TransformerException): java.lang.NoSuchMethodException: For extension function, could not find method org.apache.xml.dtm.ref.DTMNodeIterator.node-set([ExpressionContext,] )

If I process the same stylesheet with saxon, xsltproc, or 4suite, I get
no errors.

If I use the xalan function:


xsl:apply-templates select = "xalan:nodeset($phase1output)" mode = "phase2"/>

I also get no error.

If I write a script that tries to import the needed class:

import org.apache.xml.dtm.ref.DTMNodeIterator;

I get no import error. So the class is in my path and the stylesheet
seems to be set up correctly. I can't imagine this could really be a bug
in xalan, since it would have been caught by now.

Here is the full source of the code.


PS I've searced the web for quite some time now. According to Xalan's
own website, I should be doing everything correct.



    <xsl:template match = "/">
        <xsl:variable name = "phase1output">
            <xsl:apply-templates select = "." mode = "phase1"/>
        <xsl:variable name = "phase2output">
            <xsl:apply-templates select = "exsl:node-set($phase1output)" mode = "phase2"/>
        <xsl:copy-of select = "$phase2output"/>

    <!--templates for first run-->
    <xsl:template match = "doc" mode = "phase1">
        <xsl:element name = "first">
            <xsl:apply-templates mode = "phase1"/>

    <xsl:template match = "element" mode = "phase1">
        <xsl:element name = "first-element">
            <xsl:apply-templates mode = "phase1"/>

    <!--templates for second run-->
    <xsl:template match = "first" mode = "phase2">
        <xsl:element name = "second">
            <xsl:apply-templates mode = "phase2"/>

    <xsl:template match = "first-element" mode = "phase2">
        <xsl:element name = "second-element">
            <xsl:apply-templates mode = "phase2"/>


*Paul Tremblay         *

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread