geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Opacki <>
Subject XPath and dom4j
Date Sun, 17 Aug 2003 19:53:06 GMT
I'm trying to grab a particular list of nodes using
dom4j from an xml document. Some things seem to work
and some obvious things don't. My first experience
with it is it could be my lack of
understanding XPath.
I tried to get elements using this:
I'm expecting to get all of the child nodes directly
beneath /ejb-jar/enterprise-beans this way.

I am also trying to get a single attribute of a single
element using this: /ejb-jar[@version]

The only paths that seem to work are these: "//" or

this is the code...

XPath xpathSelector = DocumentHelper.createXPath(str);
List nodes =

What might I be doing wrong?


Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

View raw message