dcsimg
XML Query
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Corina_Stefan
Posted On:   Thursday, April 26, 2001 11:09 AM

Harold

How can I query my xml file? For example I have this xml file:

			
<?xml version="1.0"?>



Johnson


Harold's Fairy Tale
Crockett



and I want to display the result of "author where title = 'Harold'".
How should I write the query and where I should put it, in another xml file? or html file?

Re: XML Query

Posted By:   Chris_Leonardi  
Posted On:   Tuesday, May 1, 2001 08:30 PM

XPath provides a means of querying down into XML documents:

http://www.w3.org/TR/xpath

Look at 'Location Paths' for the syntax relevant to your particular query.

Apache Xalan implements the XPath 1.0 recommendation:

http://xml.apache.org/xalan-j/index.html

Typically, you'd write a XSL styelsheet that uses an XPath expression to traverse your document tree and select the appropriate nodes.

You can also use xpath programatically from a Java class; Xalan provides an API for that, too.
About | Sitemap | Contact