Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Setting Xpath String to do XPath query

 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK so I am trying to do an XPath query to get the value of some tag.

Here is the basic information.

XML Document



I really shortened it.

This is what I am calling to get the DOMValue

So contextNode is the Node Object for the Header tag.
xPath should be the xPath String.



In order to get the Reference Number value of 111222333 from the Reference Number tag, what is the xPath string that I need? I can then figure out what I need for all my other tags in the xml document.

Thanks

Mark

[ October 26, 2005: Message edited by: Mark Spritzler ]
[ October 26, 2005: Message edited by: Mark Spritzler ]
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by James Swan:


Thanks, but what if there is also a namespace?

Mark
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh, didn't see that part of your question.
What happens when you run the above code against your XML file and schema?
[ October 30, 2005: Message edited by: James Swan ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic