here( )
The here( ) function is only used inside XML documents. It refers
to the node that contains the XPointer or, if the node that contains
the XPointer is a text node, the element node that contains that
text node. here( ) is useful in
relative links. For example, these navigation elements link to the page elements preceding and following the
pages in which they’re contained:
<page>
content of the page...
<navigation xlink:type="simple"
xlink:href="#xpointer(here( )/../../preceding-sibling::page[1])">
Previous
</navigation>
<navigation xlink:type="simple"
xlink:href="#xpointer(here( )/../../following-sibling::page[1])">
Next
</navigation>
</page>In these elements, the here(
) function refers to the xlink:href attribute nodes that contain
the XPointer. The first ..
selects the navigation parent
element. The second .. selects
its parent page element, and the
final location step selects the previous or next page element.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access