O'Reilly logo

Special Edition Using Java™ 2 Enterprise Edition by Mark Wutka

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Navigating an XML Document with XPath

The XPath standard defines how you refer to an element in an XML document. XPath is basically a query mechanism that lets you identify nodes based on a certain pattern. The pattern can be the node's value, its children, its attributes, and even its relationship to other nodes. For example, you've already seen XSL template rules that use / to match the root element and . to match the current element. These are both XPath expressions.

For example, if you want to refer to the firstName element that is a child of the person element, you can use the XPath expression person/firstName. In some ways, it is similar to the convention you use for naming files. XPath is more than just a naming standard, however; it is ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required