W3C home > Mailing lists > Public > xmlschema-dev@w3.org > July 2001

Re: element referencing vs. type´d elements

From: Eddie Robertsson <eddie@allette.com.au>
Date: Wed, 04 Jul 2001 17:09:12 +1000
Message-ID: <3B42C117.8FE929A@allette.com.au>
To: Holger.Joukl@LBBW.de
CC: xmlschema-dev@w3.org
Hi Holger,

You may want to check out Roger Costello's Best Pratice page at
http://www.xfront.com/BestPracticesHomepage.html
Here you will find discussions on when you want to use global elements/types and what the
implications are.

<snip/>

> --- Schema 2 fragment ------------------------
>
> <complexType name="a">
>   ...
> </complexType>
>
> <element name="a" type="a">
>    ...
> </element>
>
> <element name="b">
>   <complexType>
>     <sequence>
>       <element name="a" type="a">
>     </sequence>
>   </complexType>
> </element>
>
> --------------------------------------------------------

> And what if I leave out the top-level element a in the 2nd schema?

That won't make any difference for the schema per-se other than that you can reference this from
nested complexTypes. However, by keeping the element a as a global element you can use it as the
root element in an instance document.

Cheers,
/Eddie
Received on Wednesday, 4 July 2001 03:07:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:22 GMT