Hi list
I'm trying to prepare an XML catalog for working with OGC schemas[1], more concretely the csw 2.0.2 schema[2].
This catalog's purpose is to use my locally downloaded schemas instead of fetching them from OGC's repository every time I need to validate something.
when I use xmllint without my catalog, the testing file[3] gets validated OK, but the process takes a while, because the schemas have to be fetched over the network:
# bash
export XML_DEBUG_CATALOG=1
xmllint --load-trace --noout --schema
/home/geo2/dev/xmlschemas/SCHEMAS_OPENGIS_NET/csw/2.0.2/CSW-discovery.xsd
/home/geo2/dev/xmlschemas/SCHEMAS_OPENGIS_NET/csw/2.0.2/examples/capabilities/Capabilities_tC22.xml
... (lots of downloading of schemas happening here)
Loaded URL="" ID="(null)"
/home/geo2/dev/xmlschemas/SCHEMAS_OPENGIS_NET/csw/2.0.2/examples/capabilities/Capabilities_tC22.xml validates
Now after downloading the whole opengis schemas, plus the W3C's xlink and xml schemas into some common directory I have built a catalog file like this:
<?xml version="1.0"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<rewriteURI uriStartString="
http://www.w3.org/" rewritePrefix="/home/geo2/dev/xmlschemas/w3c/"/>
<rewriteURI uriStartString="
http://schemas.opengis.net/" rewritePrefix="/home/geo2/dev/xmlschemas/SCHEMAS_OPENGIS_NET/"/>
</catalog>
When trying this out, xmllint fails saying that it cannot even compile the schema:
# bash
export XML_CATALOG_FILES=/home/geo2/dev/lixo/test_catalog.xml
xmllint --load-trace --nonet --noout --schema /home/geo2/dev/xmlschemas/SCHEMAS_OPENGIS_NET/csw/2.0.2/CSW-discovery.xsd /home/geo2/dev/xmlschemas/SCHEMAS_OPENGIS_NET/csw/2.0.2/examples/capabilities/Capabilities_tC22.xml
... (and it finally fails with)
WXS schema /home/geo2/dev/xmlschemas/SCHEMAS_OPENGIS_NET/csw/2.0.2/CSW-discovery.xsd failed to compile
So it seems that there is something missing from my xml catalog. It is almost working (no files are being downloaded from the network). I've been looking at libxml2's docs on catalogs[4], and also the OASIS spec[5], but I haven't been able to make much more from it.
Thanks for your help