xsl-list
[Top] [All Lists]

xalan node-set not working

2004-02-28 17:53:01
If I use xalan to process a stylesheet with a node-set, I get this
error:

(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:

xmlns:xalan="http://xml.apache.org/xalan";
...

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.

Thanks

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



<xsl:stylesheet 
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
    xmlns:exsl="http://exslt.org/common";
    extension-element-prefixes="exsl"
    xmlns:xalan="http://xml.apache.org/xalan";

    exclude-result-prefixes="xalan"
    version="1.1">

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

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

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

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


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

</xsl:stylesheet>
-- 

************************
*Paul Tremblay         *
*phthenry(_at_)earthlink(_dot_)net*
************************

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



<Prev in Thread] Current Thread [Next in Thread>