XML technologies / DocBook / Getting started with DocBook / Referencing a DocBook 5 schema
(Excerpt from "DocBook-XML: Medienneutrales und plattformunabhängiges Publizieren" by Thomas Schraitle)
Methods of associating a document with its DocBook schema depend on the schema language:
- DTD
With a DocBook DTD, you need a DOCTYPE declaration with the corresponding identifiers. Its structure is always the same, varying only with the DocBook version.
- RELAX NG
Surprisingly, the RELAX NG specification defines no method for associating a document with a RELAX NG schema. Specify the paths to the schema and XML document in your tools.
- W3C Schema
To use a DocBook W3C schema, use the attribute
xsi:schemaLocationon the root element.
All variants require the following structure, illustrated with a book:
Example: Structure of a DocBook 5 document
<book version="5.0"
xmlns="http://docbook.org/ns/docbook"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Inhalt -->
</book>Line 1: Every DocBook 5 root element must contain the attribute version.
Line 2: The namespace of DocBook 5.
Line 3: If you use the elements xi:include and xi:fallback from the XInclude specification, declare the namespace "http://www.w3.org/2001/XInclude" on the root element.
Line 4: If you use XLink attributes, you need the XLink namespace on the root element.
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