O'Reilly logo

Real World XML by Steven Holzner

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

XPointer Location Set Functions

Two XPointer functions return location sets:

  • here()— Returns a location set with one location, the current location

  • origin()— The same as here(), except that this function is used with out-of-link links

The here() function refers to the current element. This is useful because XPointers are usually stored in text nodes or attribute values, and you might want to refer to the current element (not just the current node). For example, you might want to refer to the second previous <NAME> sibling element of the element that contains an Xpointer; you can use an expression like this to do so: here()/preceding-sibling::NAME[position() = 2].

The origin() function is much like the here() function, but you use it with out-of-line ...

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