geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Opacki <chris_opa...@yahoo.com>
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 here..so it could be my lack of
understanding XPath.
I tried to get elements using this:
/ejb-jar/enterprise-beans
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
"@version"

this is the code...

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


What might I be doing wrong?

thanks.


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Mime
View raw message