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


From: Jane Hunter <jane@dstc.edu.au>
Date: Tue, 14 May 2002 10:04:10 +1000
Message-Id: <200205140004.g4E04Ar06244@piglet.dstc.edu.au>
To: www-xml-schema-comments@w3.org
Is it possible to base new types on "anySimpleType"? For example, 
within the Dublin Core schema we want to define a generic element which 
cannot have children or be 'mixed' but has a 'lang' attribute:

  <complexType name="DCelementType"
       <extension base="anySimpleType">
         <attribute ref="x:lang" use="optional"/>

   <element name="date" type="DCelementType/>

This approach allows users to restrict the base type in their own 
application profiles. For example, if a user wants their date element 
to use the more constrained 'date' datatype, they can define their own 
element based on the dc:DCelementType, in their own schema:

 <element name="myDate">
       <xs:restriction base="dc:DCelementType">
           <extension base="date">
             <attribute ref="x:lang" use="optional"/>

If this is not permitted, then do you have any other suggestions for 
how to do what we're trying to do - define a base simple type with a 
'lang' attribute - from which it is possible to derive other simple 
types such as date, anyURI, string etc.

| Jane Hunter                 | Senior Research Scientist           |
| DSTC Pty Ltd                | Distributed Systems Technology CRC  |
| Level 7, GP South           | Tel   : +61 7 3365 4310             |
| University of Queensland    | Fax   : +61 7 3365 4311             |
| Queensland 4072, Australia  | Email : jane@dstc.edu.au            |
Received on Monday, 13 May 2002 20:04:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:58 UTC