XML technologies / DocBook / The DocBook XSL stylesheets / Partial transformation
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
When working on one chapter, transforming the entire book can be inconvenient. The DocBook stylesheets therefore let you process just one structural element from a document. These conditions must hold:
The document is valid against its DocBook schema.
The element must have an anchor (
idfor DocBook 4 orxml:idfor DocBook 5).The stylesheets process one element and all its descendants, but no siblings.
Partial transformation is useful only for structural elements described in Structural elements.
Keep these characteristics in mind:
The entire document is loaded into memory, so parsing time and memory use do not decrease. Transformation is faster because only the anchored element is processed.
Numbering remains available because the entire document is in memory.
Numbers and titles in cross-references to other structural elements are rendered correctly.
Page numbers for references to other elements are unavailable. The resulting warning is expected: unformatted parts of the document have no page numbers.
The following example illustrates this:
<book>
<preface ANKER="preface"> ... </preface>
<chapter ANKER="intro"> ... </chapter>
<chapter ANKER="xmlintro"> ... </chapter>
</book>This document has a preface and two chapters. Their child elements are omitted for clarity. Each chapter and the preface have an anchor (id or xml:id). To select the complete chapter with the value xmlintro run xsltproc with this parameter:
xsltproc --stringparam rootid "xmlintro" ...
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