MENU
XPointer
XPointer allows links to point to specific parts of an XML document instead of the whole XML document. For instance:| xlink:href="http://example.com/cars.xml#xpointer(id('BMW'))" |
An XPointer expression referencing the element whose id attribute is 'BMW'.
Because the above example references the 'id' attribute, it can be rewritten as:| xlink:href="http://example.com/cars.xml#BMW" |
Shorthand form of the same XPointer reference.
XPointer recognizes XPath.<foobar id="foo">
<bar/>
<baz>
<bom a="1"/>
</baz>
<bom a="2"/>
</foobar>| xpointer(id("foo")) => foobar |
| xpointer(/foobar/1) => bar |
| xpointer(//bom) => bom (a=1), bom (a=2) |
| element(/1/2/1) => bom (a=1) — /1 descends into the first element (foobar), /2 descends into the second child element (baz), /1 selects the first child element (bom). |
(Courtesy of http://en.wikipedia.org/wiki/XPointer)