XML technologies / DocBook / Modular documents / Summary
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
Comparison of external entities and XIncludes
The main points of this chapter are:
Splitting documents into smaller files improves reuse and clarity and reduces loading time. Cross-file references complicate validation of individual files.
External entities or XIncludes can assemble a split document.
With external entities, included files must have no DOCTYPE declaration. Only the master file contains this reference to the DTD.
With the XInclude method, modules may have a DOCTYPE declaration.
If XInclude replacement fails, a
xi:fallbackis processed if present.XIncludes can read a referenced file as XML (the default) or as text.
By default, XInclude includes the entire referenced XML file. A XPointer expression selects a particular part. Specify it in the attribute
xpointerofinclude.An empty
hrefattribute on anxi:includeelement, together with anxpointerattribute, includes fragments from elsewhere in the same document. This improves consistency, even though it does not reduce writing effort.The elements
includeandfallbackare unknown to the DocBook 4 DTD, but can be added. This is needed only to validate files containing unresolved XInclude elements. DocBook 5 already has a file with the required customizations.
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