Altova Mailing List Archives


Multiply Defined Elements (was: Re: XML Schemas: ref'ing versusin-lining)

From: "Roger L. Costello" <costello@-----.--->
To: "'xml-dev@-----.---.---'" <-------@-----.---.--->
Date: 9/13/2000 11:17:00 AM
"Arnold, Curt" wrote:
> 
>      <element name="foo">
>         <complexType>
>            <element name="bar" type="string"/>
>            <element name="bar" type="string"/>
>         </complexType>
>      </element>
> 
> illegal (regardless of the value of type) since you have duplicate 
> declarations of the same element name within the same symbol space.  

Hmm, yes I see your point Curt.  However, Henry responded differently:

> > May I conclude that it is legal to multiply declare an element 
> > provided they all have the same type?
> 
> Yes.

Curt, what about this:

    <element name="foo"> 
       <complexType>
          <element ref="a:bar"/>
          <element ref="a:bar"/>
       </complexType>
    </element>

Would you consider this to be legal or illegal?  It's not really
defining an element twice.  Rather, it's referring to the single
declaration twice.

On the other hand, Henry says that the 'ref' form is equivalent to the
in-lined form,

> > is this:
> >
> >     <element name="foo">
> >        <complexType>
> >           <element ref="a:bar"/>
> >           <element ref="a:bar"/>
> >        </complexType>
> >     </element>
> >
> >     <element name="bar" type="string"/>
> >
> > equivalent to this:
> >
> >     <element name="foo">
> >        <complexType>
> >           <element name="bar" type="string"/>
> >           <element name="bar" type="string"/>
> >        </complexType>
> >     </element>
> 
> Yes.

which would imply that we have "defined" the element twice (and thus
illegal by your thinking).

Henry, your thoughts?  Curt, any further comments?  /Roger

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.