my dog learned polymorphism*
The moose likes XML and Related Technologies and the fly likes XPath returning Boolean not Node problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XPath returning Boolean not Node problem" Watch "XPath returning Boolean not Node problem" New topic
Author

XPath returning Boolean not Node problem

justin mcsporran
Greenhorn

Joined: May 12, 2003
Posts: 15
Hi,
I'm using the following (in dom4j) to try to get a particular element based on the unique value of an attribute (itemID), but all I seem to get back is 'true' (Boolean), not a Node. I'd be really grateful if someone could please tell me where I'm going wrong.
Code snipplet:

My test XML document:

Cheers,
Justin
justin mcsporran
Greenhorn

Joined: May 12, 2003
Posts: 15
Ah, just noticed my mistake, I think. I'm missing an asterisk and some square brackets
(ie: "//*[@itemID='" + itemID + "]'")
Cheers,
J
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XPath returning Boolean not Node problem