XML technologies / DocBook / Modular documents / Partial inclusion with XPointer / Inclusion using the attribute id or xml:id
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
DocBook can assign each element a unique anchor using the attribute id (DocBook 4 and earlier) or xml:id (DocBook 5 and later).
To use XPointer to retrieve the full content of the marked element, including its children, write:
<xi:include xpointer="ex.intro"" href="testchapter.xml"/>This abbreviates the longer expression:
<xi:include xpointer="xpointer(id('ex.intro'))" href="testchapter.xml"/>The advantage of the id() expression is that you only need the ID value, without knowing the structure. This is particularly useful when the structure changes frequently but the ID remains constant.
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