query(String query, InputStream xmlDoc)

Description

Queries an XML document using an input stream as the second argument.

Syntax

query(String query,InputStream xmlDoc)

Where:

Examples

Example 1

This example queries the bookstore for authors listed in bookstore.Xql.

FileInputStream xmlStream = new FileInputStream("doc.xml");
String result = Xql.query("/bookstore/book/author", xmlStream);

The following example queries an XML document on the Web using a URL as the search argument:

URL xmlURL = new URL("http://mywebsite/doc.xml");
String result = Xql.query("/bookstore/book/author", xmlURL.openStream());

Usage

Returns a Java string.