Altova RaptorXML Server 2024

Customizing your Catalogs

Home Prev Top Next

When creating entries in CustomCatalog.xml (or any other catalog file that is to be read by RaptorXML Server), use only the following elements of the OASIS catalog specification. Each of the elements below is listed with an explanation of their attribute values. For a more detailed explanation, see the XML Catalogs specification. Note that each element can take the xml:base attribute, which is used to specify the base URI of that element.

 

<public publicId="PublicID of Resource" uri="URL of local file"/>

<system systemId="SystemID of Resource" uri="URL of local file"/>

<uri name="filename" uri="URL of file identified by filename"/>

<rewriteURI uriStartString="StartString of URI to rewrite" rewritePrefix="String to replace StartString"/>

<rewriteSystem systemIdStartString="StartString of SystemID" rewritePrefix="Replacement string to locate resource locally"/>

 

Note the following points:

 

In cases where there is no public identifier, as with most stylesheets, the system identifier can be directly mapped to a URL via the system element.

A URI can be mapped to another URI using the uri element.

The rewriteURI and rewriteSystem elements enable the rewriting of the starting part of a URI or system identifier, respectively. This allows the start of a filepath to be replaced and consequently enables the targeting of another directory. For more information on these elements, see the XML Catalogs specification.

 

From release 2014 onwards, RaptorXML Server adheres closely to the XML Catalogs specification (OASIS Standard V1.1, 7 October 2005) specification. This specification strictly separates external-identifier look-ups (those with a Public ID or System ID) from URI look-ups (URIs that are not Public IDs or System IDs). Namespace URIs must therefore be considered simply URIs—not Public IDs or System IDs—and must be used as URI look-ups rather than external-identifier look-ups. In RaptorXML Server versions prior to version 2014, schema namespace URIs were translated through <public> mappings. From version 2014 onwards, <uri> mappings have to be used.

 

Prior to v2014: <public publicID="http://www.MyMapping.com/ref" uri="file:///C:/MyDocs/Catalog/test.xsd"/>  

V-2014 onwards: <uri name="http://www.MyMapping.com/ref" uri="file:///C:/MyDocs/Catalog/test.xsd"/>

 

How RaptorXML Server finds a referenced schema

A schema is referenced in an XML document via the xsi:scemaLocation attribute (shown below). The value of the xsi:schemaLocation attribute has two parts: a namespace part (green) and a URI part (highlighted).
 

xsi:schemaLocation="http://www.xmlspy.com/schemas/orgchart OrgChart.xsd"

 

The set of steps that is followed to find a referenced schema depends on the validation options --schemalocation-hints and --schema-mapping. Given below are the procedures for each value of the two options:

 

--schemalocation-hints=load-by-schemalocation | load-by-namespace | load-combining-both | ignore

Specifies the behavior of the xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes: whether to load a schema document and, if yes, which information should be used to find it; (the default is load-by-schemalocation).

load-by-schemalocation

1.If the URI part of the xsi:schemaLocation is mapped in a catalog, load the resulting URI

2.Load the URI directly

load-by-namespace

1.If the namespace part of the xsi:schemaLocation is mapped in a catalog, load the resulting URI.

2.Load nothing.

load-combining-both

1.If the URI part of the xsi:schemaLocation is mapped in a catalog, load the resulting URI.

2.If the namespace part of the xsi:schemaLocation is mapped in a catalog, load the resulting URI.

3.Load the URI part directly.

 

--schema-mapping=prefer-schemalocation | prefer-namespace

If schema location and namespace are both used to find a schema document, then this option specifies which of the two should be preferred during catalog lookup; (the default is prefer-schemalocation). This option is used to change the order of the first two steps in the load-combining-both variant above.

 

XML Schema specifications

XML Schema specification information is built into RaptorXML Server and the validity of XML Schema (.xsd) documents is checked against this internal information. In an XML Schema document, therefore, no references should be made to any schema that defines the XML Schema specification.

 

The catalog.xml file in the %AltovaCommonSchemasFolder%\Schemas\schema folder contains references to DTDs that implement older XML Schema specifications. You should not validate your XML Schema documents against these schemas. The referenced files are included solely to provide RaptorXML Server with entry helper info for editing purposes should you wish to create documents according to these older recommendations.

 

© 2017-2023 Altova GmbH