This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Given the following XML doc <AAA> <BBB/> <AAA> then xpath.selectSingleNode(theNode,"/AAA/BBB") returns the node BBB.
If the doc uses a default namespace, then I have to prefix the node name with an empty Namespace e.g : xpath.selectSingleNode(theNode,"/:AAA/:BBB")
And in a namescape with a prefix like :
<prefix:AAA> <prefix:BBB/> <prefix:AAA>
my XPATH now needs to be like : xpath.selectSingleNode(theNode,"/prefix:AAA/prefix:BBB")
Is there a way to define the namespace xpath will use to resolve outside of the XPATH string. I would like to be able to use : xpath.selectSingleNode(theNode,"/AAA/BBB") no matter the prefix used in my XML doc. I've tried to figure out how the PrefixResolver works..... but I failed :-(
/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="http://www.epfwiki.net/wikis/openup/" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community