XML technologies / DocBook / Customizing DocBook / DocBook 4 structure / Writing a customization file for DocBook 4
(Excerpt from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" by Thomas Schraitle)
A customization file is needed to modify DocBook 4 or combine it with another DTD. It may be complex or contain only a few lines. Its location depends on several factors:
For private customizations, keep the file alongside your DocBook documents. For a small group, install it locally or make it available on the network.
If documents are exchanged, recipients also need the customization file. One option is to publish it online together with its public and system identifiers.
Choose any filename. A general customization file looks like this:
Example: General structure of a DocBook 4 customization file
<!-- Parameter-Entities -->
<!-- Einfügen der DocBook-DTD -->
<!ENTITY % DocBookDTD PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.docbook.org/xml/4.5/docbookx.dtd">
%DocBookDTD;
<!-- Umdefinieren von Elementen und Attributen -->Line 1: Insert ENTITY declarations here: parameter entities set to IGNORE or extensions of a %local.*; entity.
Line 4: Load the DocBook 4.5 DTD through a parameter entity reference.
Line 5: Add new elements and attributes here.
This is the simplest approach. Later sections explain customization files in detail; this section introduces the concept.
Another simple case removes elements and attributes with on/off switches. This works only for simple elements with limited content models and no dependencies. A few lines in the DTD’s internal subset suffice:
Example: Simple customization in the DTD’s internal subset
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.docbook.org/xml/4.5/docbookx.dtd"
[
<!-- Überschreiben Sie hier Entity-Deklarationen oder definieren Sie neue Elemente oder Attribute -->
]>
<book>...</book>
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