[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

xalan node-set not working

Subject: xalan node-set not working
From: Paul Tremblay <phthenry@xxxxxxxxxxxxx>
Date: Sat, 28 Feb 2004 19:53:01 -0500
xalan node set
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@xxxxxxxxxxxxx*
************************

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.