XML technologies / DocBook / Getting started with DocBook / Referencing a DocBook 5 schema / W3C schema
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
To link an XML document to a W3C schema, add the attribute xsi:schemaLocation to the root element (see the following example).
Example: Linking a DocBook XML document to a W3C schema
<book version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd">
<!-- Inhalt -->
</book>The attribute xsi:schemaLocation contains namespace-name and URL pairs separated by whitespace. The example above specifies only one pair. Depending on the schema, additional pairs may be needed, for example when DocBook is combined with MathML or SVG. In that case, specify each namespace and its corresponding URL in sequence, separated by whitespace:
Example: Namespace-name and URL pairs in xsi:schemaLocation
xsi:schemaLocation="http://docbook.org/ns/docbook http://www.docbook.org/xml/5.0/xsd/docbook.xsd http://www.w3.org/1998/Math/MathML http://www.w3.org/Math/XMLSchema/mathml2/mathml2.xsd"
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