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

Re: The minimum valid anonymous complex type declaration

From: Eddie Robertsson <eddie@allette.com.au>
Date: Thu, 06 Dec 2001 09:35:54 +1100
Message-ID: <3C0EA14A.6441D05@allette.com.au>
To: Stanley Guan <Stanley.Guan@oracle.com>
CC: Schema XML <xmlschema-dev@w3.org>
> What's the minimum valid anonymous complex type declaration embedded
> in
> a valid element declaration?
>
> Is it like this:
>      <xs:element name="name1">
>          <xs:complexType/>
>      </xs:element>
> and what does it mean?

Yes, that should be the minimum anonymous type declaration enbedded in
an element declaration and the result will be an empty element with no
attributes.
The reason for this is that <complexType/> is shorthand for:

<complexType>
   <complexContent>
      <restriction base="anyType">
      </restriction>
   </complexContent>
</complexType>

So, this means we have a complexType that restricts the anyType and
since we don't declare any elements or attributes we get an empty
content model.

Cheers,
/Eddie
Received on Wednesday, 5 December 2001 17:28:36 GMT

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