Edit online

Resolving References to Remote Schemas with an XML Catalog

When a reference to a remote schema must be used in the validated XML document for interoperability purposes, but a local copy of the schema should actually be used for performance reasons, the reference can be resolved to the local copy of the schema with an XML Catalog.

For example, if the XML document contains a reference to a remote schema docbook.rng like this:

<?xml-model href="http://www.oasis-open.org/docbook/xml/5.0/rng/docbook.rng" 
    type="application/xml" schematypens="http://relaxng.org/ns/structure/1.0"?>

it can be resolved to a local copy with a catalog entry like this:

<uri name="http://www.oasis-open.org/docbook/xml/5.0/rng/docbook.rng" 
    uri="rng/docbook.rng"/>

An XML Catalog can also be used to map an XML Schema specified with a URN in the @xsi:schemaLocation attribute of an XML document to a local copy of the schema. For example, if the XML document specifies the schema with:

<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd:1.1">

the URN can be resolved to a local schema file with a catalog entry like this:

<uri name="urn:oasis:names:tc:dita:xsd:topic.xsd:1.1"
    uri="topic.xsd"/>