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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.