File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
 
Similar Threads
XSLT IllegalAddException problem
Fresher ! need help
Hashmap
normalize( ) in DOM
How to get over DOM?