W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2000

Re: Question about "Element Declarations Consistent" constraint

From: David Beech <David.Beech@oracle.com>
Date: Fri, 11 Aug 2000 12:17:56 -0700
Message-ID: <39945164.59BF88DD@oracle.com>
To: simeon@research.bell-labs.com
CC: www-xml-schema-comments@w3.org, wadler@research.bell-labs.com
I believe the answer is that the second example is ok,
i.e. anonymous types are "the same" if structurally equivalent.

A couple of clarifications are probably needed - please see below.

Jerome Simeon wrote:
> 
> Consider the following:
> 
> <<
> Constraint on Schemas: Element Declarations Consistent
> 
>   If the {particles} contains, either directly, indirectly (that is,
> within the {particles} of a contained model group, recursively) or
> implicitly two or more element declaration particles with the same
> {name} and {target namespace}, all their {type definition}s must be
> the same.
> >>

If we squint, we can see that {type definition} is in curly brackets,
and means the {type definition} property of an element declaration
component.  So we are comparing abstract components, which involves

1) modelling by value

There is no mention of reference or identity concepts in the component 
model, and I think we are supposed to read the following from the start
of chapter 3 literally: "the root is a schema, and every other vertex
is a schema component or a literal ... and every labelled edge a 
property."   This might be stressed, e.g. "...is the value of a schema 
component (not a reference to a schema component) or ...".

2) comparison

Here the intro to chapter 3 says "Equality of components for the 
purposes of this specification is always addressed at the level of 
names ...", which unfortunately overlooks anonymous types.

The intent for anonymous components was presumably to use property-by-
property equality testing, since there is no concept of identity for
them.  However, this may need additional clarification to avoid false
negatives, i.e. there may be properties that are not specified in
exactly the same way, but which we wish to consider as equal for
structural equivalence purposes.  This would be analogous to lexical v.
value comparison of simple values, althought here of course it's not a 
lexical but a component modelling issue.

> 
> What does the phrase "must be the same" mean?
> 
> Pretty clearly, the following should be ok.
> 
>        <sequence>
>          <element name="a" type="x"/>
>          <element name="a" type="x"/>
>        </sequence>
> 
> But is this ok, or not ok?
> 
>        <sequence>
>          <element name="a">
>            <type>
>              <element name="b" type="x"/>
>            </type>
>          </element>
>          <element name="a">
>            <type>
>              <element name="b" type="x"/>
>            </type>
>          </element>
>        </sequence>
> 
> -- Jerome Simeon and Philip Wadler

Hope this helps.

  David
Received on Friday, 11 August 2000 15:21:42 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:53 UTC