3. How does it work?
You write a catalog, an XML document, that maps from the identifiers that you use to the actual resources you want to use:
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<system systemId="https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
uri="/share/dtds/xhtml1-strict.dtd"/>
</catalog>
The “system
” element maps system identifiers. In this case
the XHTML1 “strict” DTD is mapped to a local file on my laptop,
/share/dtds/xhtml1-strict.dtd
.
(There are other elements for public identifiers, URIs, delegating requests
to different catalogs, doing simple string substutions, etc.)
The resolver accepts a list of catalog files, so you can have different catalogs for different projects and mix-and-match them. You don’t have to write one monolithic catalog!