Re: element name/ref uniqueness

First of, THANKS Eddie.

While I think you're right regardings the interpretation of this schema:

> > <schema>
> >     <element name="inner"/>
> >     <element name="outer">
> >         <complexType>
> >             <sequence>
> >                 <element name="inner"/>
> >                 <element name="inner"/>
> >             </sequence>
> >         </complexType>
> >     </element>
> > </schema>

and

> "When two ... particles ... have identically named element declarations
...,
> the type definitions of those declarations must be the same..." [1].

implies that two element particles with identical names are allowed and the
schema is valid,  I'm trying to put [1] in sync with [2] :

> > 2.3 For each element information item in the sequence one of the
following
> > must be true:
> > 2.3.1 The element declaration is local ...
> > 2.3.2 The element declaration is top-level ...

> <schema>
>     <element name="inner"/> <!-- Top-level declaration -->
>     <element name="outer"> <!-- Top-level declaration -->
>         <complexType>
>             <sequence>
>                 <!-- Reference to Top-level declaration -->
>                 <element ref="inner"/>
>                 <!-- Local declaration -->
>                 <element name="inner"/>
>             </sequence>
>         </complexType>
>     </element>
> </schema>

For me it looks like the <element name="inner"/> has both
a top-level declaration and a local declaration and that makes
this schema invalid (at least that's how I read the spec:
in absence of the clarification of the matter in XMLSchema.xsd
such an interpretation is possible, even if it contradicts
the intensions of the document authors ;-)

Would you please elaborate a little bit more on the [1] to [2] relations.

Thanks again,
Michael Shapiro

[1] http://www.w3.org/TR/xmlschema-1/#Model_Group_details (3.8.1)
[2]
http://www.w3.org/TR/xmlschema-1/#section-Constraints-on-XML-Representations
-of-Particles (3.9.4)

Received on Wednesday, 16 May 2001 12:51:42 UTC