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

LocPathIterator to DOM Element

Subject: LocPathIterator to DOM Element
From: José Manuel Beas <jbeas@xxxxxxxxxxx>
Date: Wed, 23 May 2001 09:21:04 +0200
jose manuel beas
Hello, everyone! Back to the list.

I've written an xslt that stores Nodesets in a Hashtable like follows:
-------------
<xsl:stylesheet xmlns:ht="/java.util.Hashtable">
    <xsl:param name="table"/>
    <xsl:template match="domain">
        <xsl:for-each select="entity">
            <xsl:variable name="name" select="concat('',@name)"/>
            <xsl:variable name="entityNode" select="."/>
            <xsl:variable name="aux"
select="ht:put($table,$name,$entityNode)"/>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>
-------------

In my application I have the method:
----------
public Element getDefinition ( String name ) {
    LocPathIterator lpi = (LocPathIterator) _tableOfEntities.get(name);
    Node n = lpi.nextNode();
    return (Element)n;
}
--------

And this method is used like follows:
-----------
Element entity = this.getDefinition(name);
NodeList nl = ((Node)entity).getChildNodes();
-----------

But the execution stops with the following error:
DOM ERROR! class: org.apache.xalan.stree.ElementImpl

I'm using LotusXSL 2.0 with VisualAge3.5 and found that the error arrises
when "getChildNodes()" is called because "entity" is not really an "Element"
or a "Node" (which both are interfaces for
org.apache.xalan.stree.ElementImpl"). But I cannot understand the "why" of
this error. Any ideas?

Thanks and Best Regards,
José Manuel Beas

E-business Consultant
SGO Software S.A
Tlf. +34 93 4127707
www.sgosoft.com




 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.