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

Re: The minimum valid anonymous complex type declaration

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 5 Dec 2001 21:47:40 +0000
Message-ID: <167113493965.20011205214740@jenitennison.com>
To: Stanley Guan <Stanley.Guan@oracle.com>
CC: Schema XML <xmlschema-dev@w3.org>
Hi Stanley,

> 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>

Sure.

> and what does it mean?

It means that the element is empty, with no attributes. An
xs:complexType element with no xs:complexContent or xs:simpleContent
child is equivalent to:

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

Restrictions with no content don't allow any element children. There's
no mixed attribute, so no text content is allowed either. Since no
attributes are declared or referenced, the element can't take any
attributes.
  
Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Wednesday, 5 December 2001 17:03:14 GMT

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