Java includes an XPath API for simplifying access to a DOM tree’s nodes. This chapter introduces you to XPath.
What Is XPath ?
XPath is a nonXML declarative query language (defined by the W3C) for selecting an XML document’s infoset items as one or more nodes. For example, you can use XPath to locate Listing 1-1’s third ingredient element and return this element node .
As well as simplifying access to a DOM tree’s nodes, XPath is commonly used in the context of XSLT (discussed in Chapter 6) where it’s typically employed to select (via XPath expressions) those input document elements that are to be ...