What Is XPointer?

XPointer is a language to be used with XML but, like XPath, is not written in XML. XPointer allows us to address fragments of an XML document. You might already be familiar with fragment identifiers in HTML/XHTML. Let's briefly look at a simple use of HTML/XHTML fragment identifiers to remind you how they work and also to examine their limitations.

To look at that, we need to create two simple XHTML files. The first, Listing 12.1, will contain a truncated table of contents for this book, and the second page, Listing 12.2, will contain a highly abbreviated version of some text representing the content of the book.

Listing 12.1. A Simplified Table of Contents for This Book in XHTML (TOC.html)
 <!DOCTYPE html PUBLIC "-//W3C//DTD ...

Get Special Edition Using XML, Second 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.