views:

84

answers:

1

I'm using an OASIS v 1.1 compatible resolver (Norm Walsh's XMLResolver in conjunction with the catalog below. However, I'm pretty sure I've made some sort of obvious error here (this is the first time I've needed to use v 1.1 features) since attempting to resolve OxChapML.dtd fails. Can anyone see something obviously wrong with this? Or even subtly wrong?

<?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"&gt;
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
        <group  xml:base="file:///Volumes/Ac-EDP/DTG/SP%20DTD%20management/OUP_DTD/">
                <public publicId="-//OXFORD//DTD OXCHAPML//EN" uri="OxChapML.dtd"/>
                <public publicId="-//OXFORD//DTD OXENCYCLML//EN" uri="xEncyclML.dtd"/>
                <public publicId="-//OXFORD//DTD OXLAWML//EN" uri="OxLawML.dtd"/>
                <public publicId="-//OXFORD//DTD OXSTRUCTML//EN" uri="OxStructML.dtd"/>
                <public publicId="-//OXFORD//DTD OXLAWREPML//EN" uri="OxLawRepML.dtd"/>
                <public publicId="-//OXFORD//DTD OXBILINGML//EN" uri="OxBilingML.dtd"/>
                <public publicId="-//OXFORD//DTD OXMONOLINGML//EN" uri="OxMonolingML.dtd"/>
                <public publicId="-//OXFORD//DTD TIMELINES//EN" uri="timelines.dtd"/>
                <systemSuffix OxChapML.dtd" systemIdSuffix="OxChapML.dtd"/>
                <systemSuffix uri="xEncyclML.dtd" systemIdSuffix="xEncyclML.dtd"/>
                <systemSuffix systemIdSuffix="OxLawML.dtd" uri="OxLawML.dtd"/>
                <systemSuffix systemIdSuffix="OxStructML.dtd" uri="OxStructML.dtd"/>
                <systemSuffix systemIdSuffix="OxLawRepML.dtd" uri="OxLawRepML.dtd"/>
                <systemSuffix systemIdSuffix="OxBilingML.dtd" uri="OxBilingML.dtd"/>
                <systemSuffix systemIdSuffix="OxMonolingML.dtd" uri="OxMonolingML.dtd"/>
                <systemSuffix systemIdSuffix="timelines.dtd" uri="timelines.dtd"/>
        </group>        
</catalog>

Update: All of the public elements resolve just fine using the xml:base set on the group element. It's only those elements that should be resolved using the systemSuffix elements that are failing. So, if I have a document that declares its DocType using a PUBLIC identifier, it will resolve with no problems (my CatalogManager.properties has a prefer=public setting in it). If, however, I just have a SYSTEM identifier (e.g "OxChapML.dtd") this should be matched by the appropriate systemSuffix but it isn't. Turning up the debugging on the resolver shows that it isn't even trying to match via systemSuffix.

A: 

Where are the DTDs located? In the same directory as the catalogue file? Your URIs are all relative. Relative URIs are resolved relative to the location of the catalogue file (unless xml:base has been set). They are not relative to the location of the XML file being validated.

It's hard to guess the issue without knowing where the various files are located relative to each other.

Are you able to get catalogue resolution working with any DTD as all?

abcoates
Apologies. I missed out various bits of useful information there. See the updated question!
Nic Gibson
Sorry, should have come back to you earlier. I just checked through my notes from the OASIS Entity Resolution TC (which wrote the XML Catalog spec). There is a known issue related to how SAX interprets relative URIs. What this means is that where you have a 'systemSuffix' definition like<systemSuffix uri="xEncyclML.dtd" systemIdSuffix="xEncyclML.dtd"/>you should use a full file URL for the 'uri', not a relative URL. Also, the line<systemSuffix OxChapML.dtd" systemIdSuffix="OxChapML.dtd"/>looks invalid.
abcoates