XML technologies / DocBook / XML catalogs / A first example
(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)
In the example “Structure of an XML catalog” you have already seen the structure of an XML catalog. Between <catalog> and </catalog> various XML elements are allowed, as listed in the following table. Attributes in bold are required; those in normal type are optional. Each element shown also allows the optional attributes id and xml:base. The former identifies the element; the latter changes the base URI (similar to HTML’s BASE element).
Table: Permitted entries in XML catalogs (version 1.0)
Element | Description/syntax |
| identifies part of a public identifier and delegates the replacement process to another XML catalog
|
| identifies part of a system identifier and delegates the replacement process to another XML catalog
|
| identifies part of a URI and delegates the replacement process to another XML catalog
|
| groups entries and specifies a base URI
|
| loads another catalog
|
| identifies a complete public identifier
|
| identifies part of a system identifier and replaces it with a URI reference
|
| identifies part of a URI and replaces it with a URI reference
|
| identifies a complete system identifier
|
| maps a URI to an alternative URI
|
Note: Difference between versions 1.0 and 1.1
Version 1.1 of the XML Catalogs specification has two new elements, systemSuffix and uriSuffix. Before using them in your catalog, check which version of the specification your XML parser supports.
The following example shows two of the most common elements, <public/> and <system/>:
Example: testCatalog.xml
<?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">
<public publicId="-//OASIS//DTD DocBook XML V4.5//EN" uri="file:///usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd" />
<system systemId="http://www.beispiel.de/dtd/v2.3.4/bsp.dtd" uri="file:///usr/share/firms/beispiel/dtd/v2.3.4/bsp.dtd" />
<nextCatalog catalog="file:///usr/local/doc/xsldbg/catalog.xml"/>
</catalog> The catalog above has the following properties:
The
publicelement maps the public identifier-//OASIS//DTD DocBook XML V4.5//ENto the pathfile:///usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd. Whenever this public identifier is requested, the catalog resolver returns the URI from the attributeuri.The
systemelement maps the URL"http://www.beispiel.de/dtd/v2.3.4/bsp.dtd"to the pathfile:///usr/share/firms/beispiel/dtd/v2.3.4/bsp.dtd.Additional entries are read using
nextCatalog. This element lets you organize your entries by topic.
Note: Notation under Windows
Under Windows, write paths with a forward slash (/) rather than a backslash (\). This means that the path C:\Programme\DocBook becomes C:/Programme/DocBook in the catalog file.
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