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 be actually used for validation 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:

<?oxygen RNGSchema="http://www.oasis-open.org/docbook/xml/5.0/rng/docbook.rng"
    type="xml"?>

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

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

An XML catalog can be used also to map a W3C XML Schema specified with an 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:

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