This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply 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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: XPath returning Boolean not Node problem
 
Similar Threads
normalize( ) in DOM
Hashmap
XSLT IllegalAddException problem
Fresher ! need help
How to get over DOM?