W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2002

Re: Feature request - anonymous simplecontent type definition within complex type definition

From: James Clark <jjc@jclark.com>
Date: Fri, 28 Jun 2002 09:40:05 +0700
To: Michael Leditschke <mike@ammd.com.au>, XML Schema Comments <www-xml-schema-comments@w3.org>
Message-ID: <861331969.1025257205@[192.168.0.221]>


> At present, when defining complex types with simple content,
> the schema REC requires a separate named type definition as the
> basis for the complex type definition

Maybe I'm missing something, but can't you avoid this by doing something 
like this

  <xs:element name="foo">
    <xs:complexType>
      <xs:simpleContent>
        <xs:restriction base="xs:anyType">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:maxLength value="8"/>
            </xs:restriction>
          </xs:simpleType>
          <xs:attribute name="bar"/>
        </xs:restriction>
      </xs:simpleContent>
    </xs:complexType>
  </xs:element>

?

James
Received on Thursday, 27 June 2002 22:42:30 GMT

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