XML technologies / DocBook / Modular documents / Partial inclusion with XPointer / Chaining multiple XPointer
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
If the required information can occur in different elements, chained XPointer expressions provide a way to retrieve it. For example, a chapter title may appear directly after chapter or within chapterinfo. To retrieve either, chain the individual XPointer expressions:
xpointer(/chapter/title) xpointer(/chapter/chapterinfo/title)If the first XPointer expression finds nothing, the second is evaluated. Chained XPointer expressions are processed until one returns an object or the end is reached. For DocBook 5, the equivalent expression is as follows (all on one line):
xmlns(db=http://docbook.org/ns/docbook) xpointer(/db:chapter/db:title) xpointer(/db:chapter/db:info/db:title)
Copyright © 2009 Millin Verlag
You may print the online version for your private use.
Otherwise, this chapter from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" is subject to the same provisions as the printed edition: the work, including all its parts, is protected by copyright. All rights are reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
Millin Verlag, Siebengebirgsring 36, 53797 Lohmar, info(at)millin.de
back to top