Re: precise definition needed for establishing identity between components that may appear multiple times (via import)

Bob Scholss writes:

>> I did not find a definition of component 
>> identity in the spec.

It's in there.  See, for example [1]:

"Complex types definitions are identified by their {name} and {target 
namespace}. Except for anonymous complex type definitions (those with no 
{name}), since type definitions (i.e. both simple and complex type 
definitions taken together) must be uniquely identified within an XML 
Schema, no complex type definition can have the same name as another 
simple or complex type definition. ..."

You will find similar text for other components where appropriate.  So, 
when two components such (e.g. two element declarations) both use a 
complex type identified by the same {target namespace, name} pair, the 
rule above allows you to infer that it is indeed the same declaration.  In 
other cases, such as where similar looking anonymous types are used, no 
notion of identity is provided, except insofar as it is generally possible 
to invent unique identities using some sort of navigational model.

In the case of <include>, you must also consider the rule from [2]:

"no definition or declaration changes once it has been established; " 

...which really means that no definition or declaration can change once it 
has been used for purposes of validation, checking constraints on schema, 
etc. Consider the case in which you include the same schema document 
multiple times.  The first rule tells you that any given named complex 
type declaration (for example) occurs at most once in the resulting 
schema.  The second rule tells you that you better check the second want 
to make sure it really matches the first, since you can't include both, 
and you can't make up rules for switching midstream.  That is why we 
provide the warning in [3]:

"NOTE: The above is carefully worded so that multiple includeing of the 
same schema document will not constitute a violation of clause 2 of Schema 
Properties Correct (§5.13), but applications are allowed, indeed 
encouraged, to avoid includeing the same schema document more than once to 
forestall the necessity of establishing identity component by component."

In other words, we know it is going to waste time if the processor has to 
repeatedly re-include the same file, checking for conflicts in type 
definitions as it goes.  We thought long and hard about the trade-offs in 
this area, and this was what seemed to us the best compromise.  I hope 
this answers your question.   Thanks.

[1] http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details
[2] http://www.w3.org/TR/xmlschema-1/#layer1
[3] http://www.w3.org/TR/xmlschema-1/#modify-schema

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

Received on Tuesday, 19 December 2000 14:43:17 UTC