W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

ComplexType derivation by restriction

From: <afo@zurich.ibm.com>
Date: Fri, 23 Mar 2001 10:51:44 +0100
To: www-xml-schema-comments@w3.org
Message-ID: <C1256A18.0035F702.00@d12mta01.de.ibm.com>



Hi,

Part I section3.4.3 Constraints on XML Representations of Complex Type
Definitions says:
"2 If the <simpleContent> alternative is chosen, the type definition
resolved to by the
actual value of the base [attribute] must be either a complex type
definition *WHOSE
 {BASE TYPE DEFINITION}* is a simple type definition or,
only if the <extension> alternative is also chosen, a simple type
definition;"

I think this is too restrictive. It should say " ... * WHOSE CONTENT TYPE *
is a simple type definition ..." . Otherwise in the following example, type
c3, which I think should be valid, would be considered invalid.

<xsd:schema>
     <xsd:compleType name="c1">
          <xsd:simpleContent>
               <xsd:restriction base="xsd:string"/>
          </xsd:simpleContent>
     </xsd:complexType>

     <xsd:compleType name="c2">
          <xsd:simpleContent>
               <xsd:restriction base="c1">
                    <xsd:maxLength value="10"/>
               </xsd:restriction>
          </xsd:simpleContent>
     </xsd:complexType>

     <xsd:compleType name="c3">
          <xsd:simpleContent>
               <xsd:restriction base="c2">
                    <xsd:maxLength value="5"/>
               </xsd:restriction>
          </xsd:simpleContent>
     </xsd:complexType>
</xsd:schema>

Regards,
Achille.
Received on Friday, 23 March 2001 04:56:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:50 GMT