|
Thanks James,
I've kind of got a better grasp of what I want to
do with the DOMDocument (i'm used to that MSXML thing). I've gotten as far
as returning a List from a document.selectNodes("my_xpath"). I need to get
at the attributes for each Node in the list. I would have thought I could
just do a ((Node) list.get(0)).getAttributes(), but the getAttributes method is
only defined in the DOMDocument object. I can't obviously cast my
list.get() to a DOMDocument, but I'd like a NamedNodeMap containing the
attributes of my selected node.
I'm running this code in a JSP page, using Tomcat
3.2.3.
For those interested, here's the code I'm using
(abridged):
<%@ page import ... (all required libraries and
classes)%>
<%
SAXReader reader = new
SAXReader();
reader.setDocumentFactory(new DOMDocumentFactory()); Document document = reader.read("url_path_to_my_xml"); List layerNodes =
document.selectNodes("//LAYER");
%>
Now how do I get the attributes for each node in the list?
Thanks in advance.
John Fletcher
Latitude Geographics Group Ltd. 257 Market Square, Victoria, B.C., Canada V8W 3C6 Tel: (250) 381.8130 Fax: (250) 381.8132 www.latitudegeo.com [EMAIL PROTECTED]
|
- [dom4j-user] I just want a DOMDocument John Fletcher
- Re: [dom4j-user] I just want a DOMDocument James Strachan
- Re: [dom4j-user] I just want a DOMDocument John Fletcher
- Re: [dom4j-user] I just want a DOMDocument James Strachan
