Hi Simon,

"file:/path/to/xmldsig-core/xmldsig-core-schema.xsd" seems like the correct
result for the "rewriteSystem" you wrote. What are you expecting to get as
the resolved URI from the catalog resolver? Have you tried opening an
InputStream for this URI yourself with java.net.URL?

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: [EMAIL PROTECTED]
E-mail: [EMAIL PROTECTED]

"Simon Bøggild" <[EMAIL PROTECTED]> wrote on 12/02/2007 02:06:23 PM:

> Hi,
>
> I'm trying to use XMLCatalogResolver as the ResourceResolver for a
> SchemaFactory when validating schemas. I've created a catalog file
> following the
http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
> .
> In the schemas that I check I have references to external schemas on
> the Internet, which is why I'm interested in keeping a local copy of
> those, and use a xml catalog to make the re-references when parsing
> schemas with SchemaFactory. It goes well for most of the referenced
> schemas, except when it comes to a particular schema:
>
http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd
.
> For some reason the local copy I'm re-referencing to is not enough to
> make the schema validate. I'm getting the following error when
> SchemaFactory tries to parse it:
>
> org.xml.sax.SAXParseException: schema_reference.4: Failed to read
> schema document 'file:/path/to/xmldsig-core/xmldsig-core-schema.xsd',
> because 1) could not find the document; 2) the document could not be
> read; 3) the root element of the document is not <xsd:schema>.
>
> The schema is imported the following way from one of the schemas I use:
>
> <import namespace="http://www.w3.org/2000/09/xmldsig#";
>             schemaLocation="http://www.w3.org/TR/xmldsig-
> core/xmldsig-core-schema.xsd"/>
>
> I'm suspecting the problem might have something to do with the
> namespace, which contains the '#' symbol? The xmldsig-core-schema does
> not import any schemas itself.
>
> I've tried using a rewrite like this:
> <rewriteSystem systemIdStartString="http://www.w3.org/TR/xmldsig-core/";
> rewritePrefix="file:///path/to/xmldsig-core/"/>
>
> and I've also tried a systemId:
> <system systemId="
http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd";
> uri="/path/to/xmldsig-core/xmldsig-core-schema.xsd"/>
>
> No matter how I seem to make the catalog I get the SAXParseException
> when SchemaFactory tries to parse the local xmldsig-core.schema file.
> All schemas are validated without any problems without the catalog.
>
> How is it possible to correct the catalog to solve the problem?
>
> Thanks,
> Simon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to