
246 • XML & Related Technologies
With reference to this XML document, let us now understand the various XPath axes, node tests, location
tests, and location paths.
6.3.3 Examples
6.3.3.1 Simple examples
The best way to understand this is to first take a look at the XPath tree for this XML document. This is shown
in Figure 6.13.
Root
Element
BOOK
Text
Structured Computer Organisation
Element
AUTHOR
Text
Andrew Tanenbaum
Element
PUBLISHER
Text
Pearson
Element
TITLE
<< More books >>
Figure 6.13 XPath tree for our books example
Let us now take a few examples.