RE: coerce mixed/element content to simple content via restriction ?

Is this valid ?

NOPE

Asir

-----Original Message-----
From: xmlschema-dev-request@w3.org
[mailto:xmlschema-dev-request@w3.org]On Behalf Of Tom Moog
Sent: Tuesday, June 11, 2002 3:09 PM
To: xmlschema-dev@w3.org
Cc: xmlschema-dev@w3.org
Subject: coerce mixed/element content to simple content via restriction
?




In a recent book on xml schema there is an example that shows a complex
type with complex content being coerced to simple content because of
an empty restriction plus mixed content.  This looks really odd and seems
to violate the idea that simple content and element content can't appear
in the same derivation hierarchy.

Is this valid ?

The author appears to know that this is unusual because she adds, "This is

the only case where a restriction element may have both a base attribute
and a simpleType child".

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >

<xs:complexType name="BaseType" mixed="true">
   <xs:sequence minOccurs="0">
     <xs:element name="a" type="xs:string" />
  </xs:sequence>
</xs:complexType>

<xs:complexType name="DerivedType" mixed="true">
  <xs:complexContent>
    <xs:restriction base="BaseType">
      <xs:simpleType>
        <xs:restriction base="xs:string" />
      </xs:simpleType>
    </xs:restriction>
  </xs:complexContent>
</xs:complexType>

</xs:schema>

Received on Tuesday, 11 June 2002 15:16:07 UTC