XPath Axes

XPath axes define and allow access to any node within an XML document, from the current node, relative to that current node. XPath axes are a little like giving directions, allowing navigation through an XML document, using the XPath data model for an XML document, as established by XPath. An XPath axis gives directions from whatever the current node is in, in terms of the current node being a current location or context within an XML document, as established by XPath.

The current node is the node currently found by the most recently executed XPath expression. Figure 10-11 shows the various XPath axes that can be used. Technically, one can find any node, from any node, using the XPath axes.

image from book
Figure 10-11: XPath axes on the current node

The syntax for applying an XPath axis is as follows :

   axis::test-on-node[predicate]   

Figure 10-12 shows some example uses of XPath axes.

image from book
Figure 10-12: Applying XPath axes


Beginning XML Databases
Beginning XML Databases (Wrox Beginning Guides)
ISBN: 0471791202
EAN: 2147483647
Year: 2006
Pages: 183
Authors: Gavin Powell

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net