Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Let’s look at how to perform streaming XPath-based XML content evaluation.
The following example calls Oracle XDK to evaluate the XPath expression without building a DOM object in memory. The example only works on a subset of XPath functions and axes (including child, descendant, attribute, text, parent, and ancestor).
Listing 6-3 XPath Evaluation with Oracle XDK Scalable DOM
package xmlbook.chp06;
import java.io.File;
import java.io.FileInputStream;
import java.net.URL;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathConstants;
import javax.xml.xpath.XPathFactory;
import oracle.xml.parser.v2.DOMParser;
import oracle.xml.parser.v2.FilePageManager;
import oracle.xml.parser.v2.XMLDocument;
import oracle.xml.scalable.BinaryStream;