[oXygen-user] Validation of no-namespace Schema-based Document

George Cristian Bina
Sat Nov 10 15:12:55 CST 2007


Hi Eliot,

oXygen supports XML Catalogs 1.1 and you can resolve the schema based on 
its suffix, so you can have something like:

<systemSuffix systemIdSuffix="simpletest_nons.xsd" 
uri="simpletest_nons.xsd"/>

that should solve all schema locations ending in simpletest_nons.xsd to 
the simpletest_nons.xsd from the same folder as your catalog file.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Eliot Kimber wrote:
> I'm trying to figure out how or if its possible to validate a 
> schema-based document against a schema where the system location is a 
> relative URI resolved through a catalog.
> 
> Here's my document element:
> 
> <document
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:noNamespaceSchemaLocation="simpletest_nons.xsd">
> 
> This document validates when it's in the same directory as the schema.
> 
> Here is my catalog:
> 
> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
>   prefer="public">
>   <system systemId="simpletest_nons.xsd"
>     uri="simpletest_nons.xsd"
>   />
>   <uri name="simpletest_nons.xsd"
>     uri="simpletest_nons.xsd"
>   />
>   <uri name="urn:simpletest.gidi.org"
>     uri="simpletest.xsd"
>   />
> </catalog>
> 
> When I try to validate the above document stored in a location separate 
> from the schema, validation fails with messages to the effect that it 
> can't find the schema, with an effective URI that reflects the location 
> of the document.
> 
> Actually I get the same sort of failure for a namespaced document valid 
> against a namespace-governing schema, e.g.:
> 
> <document
>     xmlns="urn:simpletest.gidi.org"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="urn:simpletest.gidi.org simpletest.xsd">
> 
> Is it possible to use catalogs to remap non-absolute URIs in this way or 
> must I use absolute URIs for the schema location value?
> 
> Thanks,
> 
> E.



More information about the oXygen-user mailing list