Re: Confused about name-space declarations..

Bob Schloss writes:

>>  and they ignore schemaLocation attributes 
>>of <import> <include> and <redefine> element
>> information items in any schemas they process.

Well, this is not strictly a legal behavior for <include> and <redefine>. 
Section 4.2.1 of structures (regarding <include>) says:

"The ·XML Schema· corresponding to <schema> contains not only the 
components corresponding to its definition and declaration [children], but 
also all the components of all the ·XML Schemas· corresponding to any 
<include>d schema documents.
[...]
It is not an error for the ·actual value· of the schemaLocation 
[attribute] to fail to resolve it all, in which case no corresponding 
inclusion is performed. It is an error for it to resolve but the rest of 
clause 1 above to fail to be satisfied. Failure to resolve may well cause 
less than complete ·assessment· outcomes, of course. "

For comparison, section 4.2.3 says:

"The ·actual value· of the schemaLocation, if present, gives a hint as to 
where a serialization of a ·schema document· with declarations and 
definitions for that namespace (or none) may be found. When no 
schemaLocation [attribute] is present, the schema author is leaving the 
identification of that schema to the instance, application or user, via 
the mechanisms described below in Layer 3: Schema Document Access and 
Web-interoperability (§4.3)."

So technically, schemaLocation is a hint for <import> and dereferencing is 
(implied to be) mandatory on <include>.  Certainly the implication is that 
the "hint'" like nature is made very clear for <import>, and <include> 
essentially says " the compents are included." 

Now, what strikes me as weird, other than that the 4.2.1 wording is vague, 
 is that it's OK if the dereference fails, but it seems not OK to fail to 
try.  So, the implication is that if you can somehow convince yourself 
that the reason you didn't do the dereference is that you are running in 
some sort of situation where it wouldn't work, you're OK.  I find this 
somewhat bizarre.

The fact is that there is an intentional and well-motivated distinction 
between the semantics of <import> and <include>.  In brief, the base form 
of <import namespace="nsuri"/> takes no schemaLocation at all.  It's a bit 
like Java import:  it just brings the namespace into scope, without 
necessarily telling you where to find the schema document...that's up to 
the processor.   In the case of <include> you already have a schema 
document which is specifically trying to tell you that it has been written 
in pieces, more like C-language #include, so the whole point of <include> 
is to tell you where the file is.  What I find somewhat incoherent is the 
permission to quietly proceed if the <include> fails to find the file.

Henry:  do I have this about straight?

------------------------------------------------------------------------
Noah Mendelsohn                                    Voice: 1-617-693-4036
Lotus Development Corp.                            Fax: 1-617-693-8676
One Rogers Street
Cambridge, MA 02142
------------------------------------------------------------------------

Received on Friday, 5 October 2001 14:53:15 UTC