[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: target namespace and namespaces

From: Jeff Rafter <lists@jeffrafter.com>
Date: Fri, 03 Dec 2004 08:00:46 -0800
Message-ID: <41B08DAE.6090902@jeffrafter.com>
To: Dan Vint <dvint@dvint.com>
CC: xmlschema-dev@w3.org
Re: target namespace and namespaces

> In the Namespace spec I can't see any guidance on this question and with 
> the schema spec saying schema location information is optional and at 
> best a hint I don't see any help there either. With the schema location 
> info being a "hint" there seems to be no way to make clear that I would 
> want namespace foo with schema 1 rather than schema 2. So I lean towards 
> this not being necessarily illegal, but a REALLLLLY poor design.

As Xan said, your assumption about <include> was incorrect-- you can 
include items in the same namespace. This leaves you three options as 
near as I can tell:

(1) Create a "driver" or "master" schema-- this does nothing more than 
<include> your two divergent but like-namespaced schemas. Now you are 
back to one schema, which you prefer.

(2) Include more than one schema in the schemaLocation hint

   xsi:schemaLocation="http://foo schema1.xsd
                       http://foo schema2.xsd"

Unfortunately support for this is spotty.

(3) Use some other out of band mechanism. For example in Xerces or MSXML 
you can list multiple schemas to be used for validation. Additionally 
there is RDDL which allows you to identify which schemas can be used to 
validate items coming from a particular namespace (XSV supports this but 
again support for this is not very common) or use NRL (namespace routing 
language) which should allow you to do exactly what you want. Of course 
I haven't seen support for NRL in any XML Schema processor...

So of these... option (1) is the most stable.

Cheers,
Jeff Rafter
Received on Friday, 3 December 2004 16:01:16 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.