XML technologies / DocBook / XML catalogs / XML catalogs verification
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
If a DTD cannot be found, a missing or incorrect catalog entry is often the cause. There are two ways to trace resolution:
using the program
xmlcatalogusing the variable
XML_DEBUG_CATALOGand the programxmllint
The command xmlcatalog can add or remove catalog entries and also perform lookups. This example uses the catalog from "testCatalog.xml". Entering
xmlcatalog testCatalog.xml "-//OASIS//DTD DocBook XML V4.5//EN"produces
file:///usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd
The option -v makes the command more verbose:
Resolve pubID -//OASIS//DTD DocBook XML V4.5//EN
0 Parsing catalog testCatalog.xml
testCatalog.xml added to file hash
Found public match -//OASIS//DTD DocBook XML V4.5//EN
file:///usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd
Catalogs cleanup
Free catalog entry -//OASIS//DTD DocBook XML V4.5//EN
Free catalog entry http://www.beispiel.de/dtd/v2.3.4/bsp.dtd
Free catalog entry file:///usr/local/doc/xsldbg/catalog.xml
Free catalog entry testCatalog.xml
Free catalog entryRun this test before investigating other causes. It helps locate typos in your catalog file more quickly.
The other method uses the environment variable XML_DEBUG_CATALOG. To use the preceding catalog (file testCatalog.xml) with the XML parser xmllint, also set the environment variable XML_CATALOG_FILES to the relevant catalogs. A command using an XML file looks like this:
Linux:
XML_DEBUG_CATALOG=1 XML_CATALOG_FILES=./testCatalog.xml \
xmllint --valid --noout test.xmlWindows:
set XML_DEBUG_CATALOG=1
set XML_CATALOG_FILES=./testCatalog.xml
xmllint --valid --noout test.xmlThis command produces the same output as the preceding command using xmlcatalog.
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