XML technologies / DocBook / Customizing DocBook / DocBook 4 structure / Validating with a DocBook 4 customization file
(Excerpt from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" by Thomas Schraitle)
The previous section explained the structure of a DocBook 4 customization file. To use it for your documents, proceed as follows:
First add a DOCTYPE declaration to every XML file belonging to your document. In Writing a customization file for DocBook 4 you learned that there are two options:
Customization file in the same directory as the XML files
Use the following syntax in your XML file if you do not exchange documents with others:
<!DOCTYPE book SYSTEM "mydb.dtd">Referencing the customization file independently of the platform
Use public and system identifiers if you exchange documents or process them on different operating systems. Name your identifiers (see Naming DocBook 4 customizations). For example:
<!DOCTYPE book PUBLIC "-//Tux//DTD DocBook V4.5-Subset//EN" "http://www.example.com/docbook/mydb.dtd">Also use an XML catalog and add the following lines:
<public publicId="-//Tux//DTD DocBook V4.5-Subset//EN" uri="PATH"/>
<system systemId="http://www.example.com/docbook/mydb.dtd" uri="PATH"/>Replace PATH with the path to your customization file.
If you use an XML catalog, set the environment variable
XML_CATALOG_FILESin your shell and replaceKATALOGwith the path and filename of your XML catalog:For Linux:
export XML_CATALOG_FILES=KATALOGFor Windows:
set %XML_CATALOG_FILES%=KATALOG
Validate your XML document. Replace
XMLDATEIwith your XML document’s filename:xmllint --valid --noout XMLDATEI
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