XPath in Xerces parser
1 posts in topic
Flat View  Flat View

Posted By:   Anonymous
Posted On:   Friday, July 12, 2002 02:22 AM

Hi all,

Does anyone know how to navigate to a specific node in an DOM document using XPath. If you have tried MSXML parser then my question is asking about something like SelectSingleNode(String query) where query can be an XPath expression such as: /bookstore[@specialty = "textbooks"]

I am currently using parser Xerces.
Thanks in advance!

Re: XPath in Xerces parser

Posted By:   Laurent_Mihalkovic  
Posted On:   Friday, July 12, 2002 03:59 AM

Look at xerces, it comes with the org.apache.xpath package which contains the XPathAPI class. The class contains a set of static helped methods for using XPath expressions. In particular, you'll see that there are a set of selectXXX methods.

Alternatively, you may also look at JDOM or DOM4J as alternative APIs for manipulating XML documents. JAXEN is a free XPATH implementation that you can also look at.


About | Sitemap | Contact