Customizing Your Catalogs
When creating entries in CustomCatalog.xml (or any other catalog file that is to be read by XMLSpy), 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, XMLSpy 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 XMLSpy 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 XMLSpy 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"
Given below are the steps, followed sequentially by XMLSpy, to find a referenced schema. The schema is loaded at the first successful step.
1.Look up the catalog for the URI part of the xsi:schemaLocation value. If a mapping is found, including in rewriteURI mappings, use the resulting URI for schema loading.
2.Look up the catalog for the namespace part of the xsi:schemaLocation value. If a mapping is found, including in rewriteURI mappings, use the resulting URI for schema loading.
3.Use the URI part of the xsi:schemaLocation value for schema loading.
File extensions and intelligent editing according to a schema
Via catalog files you can also specify that documents with a particular file extension should have XMLSpy's intelligent editing features applied in conformance with the rules in a schema you specify. For example, if you create a custom file extension .myhtml for (HTML) files that are to be valid according to the HTML DTD, then you can enable intelligent editing for files with these extensions by adding the following element of text to CustomCatalog.xml as a child of the <catalog> element.
<catalog>
...
<spy:fileExtHelper ext="myhtml" uri="schemas/xhtml/xhtml1-transitional.dtd"/>
...
</catalog>
This would enable intelligent editing (auto-completion, entry helpers, etc) of .myhtml files in XMLSpy according to the XHTML 1.0 Transitional DTD. Refer to the catalog.xml file in the %AltovaCommonSchemasFolder%\Schemas\xhtml folder, which contains similar entries.
XML Schema specifications
XML Schema specification information is built into XMLSpy 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 XMLSpy with entry helper info for editing purposes should you wish to create documents according to these older recommendations.