XML technologies / DocBook / XML catalogs / XML catalogs creation

(Excerpt from "DocBook-XML: Media-neutral and platform-independent publishing" by Thomas Schraitle)

You can create a catalog file manually or automatically with the program xmlcatalog (package libxml2). Create an empty catalog catalog.xml as follows:

xmlcatalog --noout --create catalog.xml 

Add new entries with the option --add. Specify the type (public, system, …), the original string/URI and the replacement text:

xmlcatalog --add public \ 
  "-//OASIS//DTD DocBook XML V4.5//EN" \
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \ 
  catalog.xml

The option -add allows only the types public, system, rewriteSystem, delegatePublic or delegateSystem. After the command, the file catalog.xml looks as follows:

<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="http://www.docbook.org/xml/4.5/docbookx.dtd"/>
</catalog>

To remove an entry, invoke xmlcatalog with the option --del:

xmlcatalog--del \ 
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" \ 
  catalog.xml

This command removes an entry that matches the supplied string exactly (case-sensitive!).

The command xmlcatalog is well suited to editing catalog files in scripts without knowing their exact format.

  

back to top