Re: The minimum valid anonymous complex type declaration

Jeni and Eddie,

Thanks for your answers!  I just want to point out my original
observations:
    <xs:element name="name1">
and
    <xs:element name="name2">
        <xs:complexType/>
    </xs:element>
have one line difference, but quite different interpretation!

Thx,

-Stanley

Jeni Tennison wrote:

> 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 18:35:38 UTC