XML technologies / DocBook / XML catalogs / Why use catalogs?
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
Accessing resources through a path raises several difficulties:
Directory structures vary considerably between operating systems: Linux uses the forward slash, DOS/Windows the backslash, and MacOS before version 10 the colon.
Some operating systems impose restrictions: they limit filename length or do not distinguish uppercase from lowercase.
When documents are exchanged, the data resides at a different location in the recipient’s filesystem than in the sender’s.
Catalogs solve these problems. They make your XML environment adaptable, mainly for the following reasons:
- Processing speed
In simple terms, XML catalogs replace Internet addresses with operating-system-specific paths. The resource is then loaded from your local hard disk, increasing processing speed, provided that you have a local copy.
- Portability
Processing XML documents on different operating systems causes difficulties due to different paths or unfamiliar syntax. Generic URIs move the operating-system-specific part into catalogs and reduce these problems when exchanging documents.
- Centralization
Catalogs give you one central location for configuring generic URIs for all your XML files and documents.
These features make catalogs useful in several interesting scenarios:
Resolve a generic URI in different ways by assigning different catalogs at runtime to the XML parser.
Use a constant URI in makefiles, DTDs, stylesheets, and other files that remains valid when moved to another path or computer.
Test new versions of DTDs, schemas, or stylesheets by mapping the URI to the new path in the catalog.
An XML catalog has the following structure:
Example: Structure of an XML catalog
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<!-- Einträge -->
</catalog> Line 2: The optional DOCTYPE declaration. Some XML parsers have the catalog DTD built in and do not need an Internet connection. If errors occur, remove the DOCTYPE declaration.
Line 3: The root element catalog is bound to the namespace urn:oasis:names:tc:entity:xmlns:xml:catalog.
Line 4: Insert your entries here to rewrite URIs as the corresponding paths.
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