Example DocBook catalog file

Here is a complete example of an XML catalog file that can resolve PUBLIC and SYSTEM identifiers for the DocBook DTD, and references to stylesheets. It assumes all the DocBook files are stored under /usr/share/xml so the group xml:base="/usr/share/xml/" element provides the main pathname prefix. You would need to replace that path with your own. If your system puts the stylesheet under a different location from the DTD, then you would need two group elements to specify the two xml:base values.

Example 4.4. Example XML catalog file

<?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">

  <!-- DTD and stylesheet files installed under /usr/share/xml -->
  <group  xml:base="file:///usr/share/xml/" >

    <!-- Resolve DTD URL system ID to local file -->
    <rewriteSystem
        systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4/"
        rewritePrefix="docbook44/" />
    <!-- Resolve stylesheet URL to local file -->
    <rewriteURI
        uriStartString="http://docbook.sourceforge.net/release/xsl/current/"
        rewritePrefix="docbook-xsl-1.68.1/" />

    <!-- Resolve DTD PUBLIC identifiers -->
    <nextCatalog  catalog="docbook44/catalog.xml" />

    <!-- To resolve simple DTD SYSTEM identifiers. -->
    <!-- Note: this does not work with Java resolver -->
    <!--   classes in Saxon or Xalan -->
    <system
         systemId="docbook.dtd"
         uri="docbook44/docbookx.dtd" />

    <!-- To resolve short stylesheet references -->
    <uri
        name="docbook.xsl"
        uri="docbook-xsl-1.68.1/html/docbook.xsl" />
    <uri 
        name="chunk.xsl"
        uri="docbook-xsl-1.68.1/html/chunk.xsl" />
    <uri
        name="fo-docbook.xsl"
        uri="docbook-xsl-1.68.1/fo/docbook.xsl" />

  </group>

</catalog>