normative schema is written in RELAX NG with several additional constraints expressed in Schematron
DTD and W3C XML Schemas are provided for compatibility with tools that do not yet support RELAX NG
these schemas are more relaxed then RELAX NG one
some documents that can be valid against DTD or W3X XML Schema need not to be valid DocBook V5.0 instances
conclusion: use RELAX NG (+ Schematron) for validation if possible
DocBook V4.5:
<?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 really very short article.</para> </article>
DocBook V5.0:
<?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 really very short article.</para> </article>
document type information is no longer carried using !DOCTYPE,
but namespace and version
attribute is used instead