Relaxing with DocBook
For more than a decade, the DocBook schema was defined using a DTD. However, DTDs have serious limitations, and DocBook V5.0 is thus defined using a powerful schema language called RELAX NG. Thanks to RELAX NG, it is now much easier to create customized versions of DocBook, and the content models are now cleaner and more precise.
Using RELAX NG has an impact on the document prolog. Example 1-1 shows the typical prolog of a DocBook 4.x document. The version of the DocBook DTD (in this case V4.5) is indicated in the Document Type Declaration (<!DOCTYPE>) that points to a particular version of the DTD.
Example 1-1. DocBook V4.5 document
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE article PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd'>
<article lang="en">
<title>Sample article</title>
<para>This is a very short article.</para>
</article>In contrast, DocBook V5.0 does not depend on
DTDs anymore. Instead of the Document Type Declaration,
the version attribute identifies the
DocBook version, as shown in Example 1-2.
Example 1-2. DocBook V5.0 document
<?xml version="1.0" encoding="utf-8"?> <article xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en"> <title>Sample article</title> <para>This is a very short article.</para> </article>
DocBook V5.0 is built on top of existing
XML standards as much as possible. For example, the
lang attribute is superseded by the
standard xml:lang attribute.
Another fundamental ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access