Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

CHAPTER 6 Navigating XML with XPath > Processing XPath in Java

Processing XPath in Java

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;


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial