Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XPath returning Boolean not Node problem

 
justin mcsporran
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, just noticed my mistake, I think. I'm missing an asterisk and some square brackets
(ie: "//*[@itemID='" + itemID + "]'")
Cheers,
J
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic