Bush, Chris wrote:
> I am new to Jdom and have a question. I am trying use the following code to
> extract out "legIds" from the attached xml. However, I seem to get the same
> legId value twice, rather than the 2 distinct values I am expecting. Am I
> doing something wrong ?
Your second XPath expression is incorrect:
XPath legpath = XPath.newInstance("//legId");
An XPath expression starting with "//" is evaluated from the document root.
What you what is an expression which is relative to the current node.
Try with ".//legId" (the dot in first position makes it relative).
Laurent
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)