Re: Schema Location for instance document

James Delmonico asks:

>> Is it appropriate for a software system to select a priori known schemas 
based on the namespaces used in the document?  (my assumption being that 
namespace URIs are unique) 

My view, not speaking official for the schema WG is:  "yes, absolutely 
that's appropriate", though there can be some drawbacks to doing things 
this way (see below).  A schema processor can, as you point out, use any 
desired means to asssmeble the schema documents (or other sources of 
schema information) needed for a validation.  Anyone building an 
application should use a processor that does such assembly in a manner 
appropriate to the application.  For example, some applications will wish 
to trust hints in an instance, while other applications are validating 
exactly because the instance is not trusted.

Anyway, you can indeed use namespace names to suggest schema documents, 
though the recommendation provides no normative means of doing this.  I 
think the option you have in mind is to attempt to treat the URI that is 
the namespace name as the URI of a schema document.  That's OK.  You could 
also use it as a key to some sort of registry of schema documents. 

One warning:  during the design of XML schema, we considered making the 
"open the namespace name as a schema document" the default and came up 
with at least two downsides of this.  1) there may be other things that 
you want to put "at the other end" of a namespace URI.  RDDL documents [1] 
are a common proposal these days...note that the schema rec allows you do 
build a resolver that opens a RDDL document and finds a schema there and 
[2] we had implementation reports from vendors who built earlier schema 
languages that used namespaces to name schema documents---they reported 
excessive network timeouts in the relatively common cases where such 
namespace names failed to resolve.  So, these sorts of behavior are 
allowed in not required of XML Schema processors.  If none of these are 
serious concerns for you, then by all means find a processor that treats 
namespace names as schema document URIs.  We put in xsi:schemaLocation to 
mitigate some of these problems in circumstances where you do want the 
instance to suggest a schema.

I hope this analysis is helpful.

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------

Received on Wednesday, 30 June 2004 12:26:59 UTC