Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes XML and Related Technologies and the fly likes Setting contextNode parameter for XPath use Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Setting contextNode parameter for XPath use" Watch "Setting contextNode parameter for XPath use" New topic
Author

Setting contextNode parameter for XPath use

Dave Ehrlich
Greenhorn

Joined: Nov 12, 2002
Posts: 20
I want to use the SelectSingleNode method of the XPathAPI class, but I don't understand how to set the contextNode input parameter which is of type Node.
The context of what I want to be searched is my XML document which is in a file. How do I get my XML document into a Node object so that I can pass it in as the contextNode parameter?
Any help would be appreciated.
Thanks,
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Setting contextNode parameter for XPath use
 
Similar Threads
ContextNode for selectSingleNode xmlParserV2
JAXP Problem!!
Get data by Matching ID's from two different XML documents
Resolving namespace using xpath
java.lang.ArrayIndexOutOfBoundException: -1 error while using selectNodeList(contextNode,string)