Using a Catalog Resolver
Introduction
This sample shows a how to configure the default catalog resolver for use with the command-line tool and the PipelinedComparatorS9 API. This document describes the concepts behind the use of a catalog resolver. For the resources associated with this sample, see here.
OASIS Catalog Support
The XML Compare product is shipped with a slightly customized variant of the Apache commons OASIS catalog resolver - version 1.2, which fixes some of the published bugs and provides an enhancement for locating resolvable entities using Java's resource loading mechanism. Details of this customization are on our catalog resolver page.
Locating the catalogs
The provided catalog resolver reads the Java xml.catalog.files
system property to determine where the catalogs are located. This can be achieved by
setting the system property in the source code,
supplying a JVM (Java Virtual Machine) argument, or
reading a DeltaXML configuration properties file.
The first of the techniques used to set the Java xml.catalog.files
property is used, unless technique (1) is used after the call to setup the default DeltaXML catalog support; hence, technique (1) should be applied before any invocation of either a Catalog or DeltaXML method.
The sample code uses a DeltaXML configuration properties file (deltaxmlConfig.xml) to set the xml.catalog.files
system property.
Note that if the xml.catalog.files
system property is not set then the "catalogs" entry in a Apache commons CatalogManager.properties file is used instead.
Running the Sample
The resources for this sample can be downloaded from here. Instructions for running the sample are in the README.md file, displayed below the source in Bitbucket. The resources should be checked-out, cloned or downloaded and unzipped into the samples directory of the XML Compare release. The resources should be located such that they are two levels below the top level release directory, for example DeltaXML-XML-Compare-10_0_0_j/samples/catalog
.
Do use the provided catalog for svg and mathml you can do the following below.
java -Dxml.catalog.files=DeltaXML-XML-Compare-10_0_0_j/samples/catalog/catalog.xml
command-{version}.jar
Further information
The general DeltaXML's configuration properties documentation for how properties can be specified in general.
The Javadoc comments in FilesWithCatalog.java contain further implementation specific details.
Useful catalog resources:
Other resources:
If you want to use a file URI that is a local path to your catalog file, you must take care to specify the URI using the correct form, as specified in IETF RFC 8089 - the file URI scheme