W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2002

Restricting the simpleContent of a complexType

From: <lispj@mail.ukoln.ac.uk>
Date: Wed, 15 May 2002 07:30:05 +0100 (BST)
To: xmlschema-dev@w3.org
Message-ID: <1021444205.3ce2006d4b73d@webmail.bath.ac.uk>
Cc: lispj@ukoln.ac.uk

I'm trying to derive a new complexType by restricting the simpleContent of a 
base complexType. e.g. (assuming I have declaration and an import for the "x:" 

  <xs:complexType name="baseType">
      <xs:extension base="xs:string">
        <xs:attribute ref="x:lang" use="optional"/>

  <xs:complexType name="RFC1766">
    <xs:restriction base="baseType">
          <xs:restriction base="xs:language"/>
        <xs:attribute ref="x:lang" use="prohibited"/>

It seemed to me this should be OK as xs:language is derived from xs:string. As 
far as I can see, this _seems_ to be acceptable to the XSV (latest release), 
Xerces Java 2 (latest release) and MSXML (probably not quite the most recent 
update), but XML Spy rejects it (complaining that xs:simpleType is unexpected 
at that location in the derived type definition). 

I'm inclined to go with the majority vote here, but I would welcome some 
reassurance that this is OK - or, indeed, a clear indication that it is broken!

Thanks very much

Pete Johnston
Received on Wednesday, 15 May 2002 12:26:33 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:56 UTC