|
|
You can think of XPath as a mechanism by which you can specify a node or a set of nodes ('node set') of an XML document that need to be processed in some fashion. Since an XML document consists of hierarchically related data, it makes sense that you need the ability to select the descendants, ancestors, and siblings of a given node (called the 'context node'). XPath gives you this ability partly by providing thirteen 'axes,' each of which generates a (possibly empty) set of nodes relative to the context node. You've already seen the 'ancestor' axis and the 'descendant' axis in the previous section. In case you're interested, the complete list of axes is given below:
ancestor
ancestor-or-self
attribute
child
descendant
descendant-or-self
following
following-sibling
namespace
parent
preceding
preceding-sibling
self
This appendix contains examples that will illustrate the use of some of these axes.
|
|