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"

<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 -->
        rewritePrefix="docbook44/" />
    <!-- Resolve stylesheet URL to local file -->
        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 -->
         uri="docbook44/docbookx.dtd" />

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