XML Catalogs

Defines mappings for external resource identifiers.

  • Sometimes a reference to an external entity/source cannot accessed very easily and it would be handier if we could use a local version instead.

  • Example html DOCTYPE:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  • The URI specified "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" is accessed over 'http' and this will always be slower than using a local version.

  • We could now define a Catalog entry which maps the publiId "-//W3C//DTD XHTML 1.0 Transitional//EN" to a different URI.

    <public publicId="-//W3C//DTD XHTML 1.0 Transitional//EN" uri="xhtml1-transitional.dtd"/>
  • If we now supply the catalog to our XML Parser, the 'http' call will be substituted by a call to our local version.

Note

Associating a XML Catalog depends totally on what mechanism is provided by the XML Processor.