Working with XML CatalogsEdit online
Oxygen XML Editor plugin uses XML Catalogs to resolve references for validations and transformations and they are especially helpful for resolving external resources when internet access is not available or your connection is slow.
Oxygen XML Editor plugin supports any XML Catalog file that conforms to one of the following:
- OASIS XML Catalogs Committee Specification v1.1.
- OASIS Technical Resolution 9401:1997, including the plain-text flavor described in that resolution.
The version 1.1 of the OASIS XML Catalog specification introduces the possibility to map a system ID, public ID, or a URI to a local copy using only a suffix of the ID or URI used in the actual document. This is done using the catalog elements systemSuffix and uriSuffix.
Depending on the resource type, Oxygen XML Editor plugin uses different catalog mappings.
| Doc Type | Referenced Resource | Mappings |
|---|---|---|
| XML | DTD | system or public
The Prefer option controls which one of the mappings should be used. |
| XML Schema |
The following strategy is used (if one step fails to provide a resource, the next
is applied):
|
|
| Relax NG | ||
| Schematron | ||
| NVDL | ||
| XSL | XSL/ANY | URI |
| CSS | CSS | URI |
| XML Schema | XML Schema |
The following strategy is used (if one step fails to provide a resource, the next
is applied):
|
| Relax NG | Relax NG |
Creating an XML Catalog with a Template
An XML Catalog file can be created quickly in Oxygen XML Editor plugin starting from the two document templates called OASIS XML Catalog 1.0 and OASIS XML Catalog 1.1. They are available when creating new document templates.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.1//EN" "http://www.oasis-open.org/committees/entity/release/1.1/catalog.dtd"> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"> <!-- Use "system" and "public" mappings when resolving DTDs --> <system systemId="http://www.docbook.org/xml/4.4/docbookx.dtd" uri="frameworks/docbook/4.4/dtd/docbookx.dtd"/> <!-- "systemSuffix" matches any system ID ending in a specified string --> <systemSuffix systemIdSuffix="docbookx.dtd" uri="frameworks/docbook/dtd/docbookx.dtd"/> <!-- Use "uri" for resolving XML Schema and XSLT stylesheets --> <uri name="http://www.oasis-open.org/docbook/xml/5.0/rng/docbook.rng" uri="frameworks/docbook/5.0/rng/docbookxi.rng"/> <!-- The "uriSuffix" matches any URI ending in a specified string --> <uriSuffix uriSuffix="docbook.xsl" uri="frameworks/docbook/xsl/fo/docbook.xsl"/> </catalog>
How Oxygen XML Editor plugin Determines which Catalog to Use
Oxygen XML Editor plugin uses XML Catalogs to resolve references for validations and transformations and it maps such references to the built-in local copies of the schemas associated with the various frameworks (DocBook, DITA, TEI, XHTML, SVG, etc.)
Oxygen XML Editor plugin includes default global catalogs as well as default catalogs for each of the built-in frameworks, and you can also create your own.
- Global user-defined catalogs that are set in the XML Catalog preferences page.
- User-defined catalogs that are set for each frameworks in the Catalog tab of the Document Type configuration dialog box.
- Default built-in catalogs.
Example:
An XML Catalog can be used to map an XML Schema specified with an URN in the
xsi:noNamespaceSchemaLocation attribute of an XML document to a local copy
of the schema.
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:oasis:names:tc:dita:xsd:topic.xsd:1.1">
<uri name="urn:oasis:names:tc:dita:xsd:topic.xsd:1.1" uri="topic.xsd"/>