Points and ranges

XPointer expressions do not have to target an entire, single element instance. Instead, they can target a point in the document structure between elements, or a range of elements. These concepts are analogous to editing tool user interfaces, which have a current cursor position, or a range of selected material (and these concepts should also be familiar to those readers of Chapter 21 (DOM Level 2)).


A point is a single location in the document. This location is identified as being within a specific container node, and between specific sibling nodes within that container. Its position within the sibling nodes is a simple index value that starts at zero. The following example shows the points within a container Book element ...

Get XML Companion, The, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.