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

RE: redefining base element integer

From: Michael Kay <mike@saxonica.com>
Date: Tue, 29 May 2007 21:15:20 +0100
To: "'Willi Weichselbaumer'" <williweichselbaumer@hotmail.com>, <xmlschema-dev@w3.org>
Message-ID: <013101c7a22e$15457fa0$6401a8c0@turtle>
The thought of redefining one of the basic built-in types is something I
find pretty horrifying, though on a quick glance I can't see what rule
disallows it. However, you can only redefine a simple type to a restriction
of that type, that is something that allows a subset of the original value
space. You're trying to extend the value space.
 
Michael Kay
http://www.saxonica.com/
 
 


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Willi Weichselbaumer
Sent: 29 May 2007 20:43
To: xmlschema-dev@w3.org
Subject: RE: redefining base element integer


Hi Michael, 
 
thanks for your suggestion:
 
<xs:simpleType name="emptyString">
   <xs:restriction base="xs:string">
      <xs:pattern value=""/>
   </xs:restriction>
</xs:simpleType>
 
<xs:simpleType name="myinteger">
   <xs:union memberTypes="xs:integer xs:emptyString"/>
</xs:simpleType>
 
 
works well, but how do I do a redefine?
 
<xs:redefine schemaLocation="http://www.w3.org/2001/XMLSchema.xsd">
   <xs:simpleType name="integer">
     ...
   </xs:simpleType>
</xs:redefine>
 
 
no matter what I try it seems to be invalid.
 
What I try to accomplish is that a valid integer can be an integer or an
empty string. I want to do this wit some other data types as well.
 
 
Thanks,
 
 
Willi


  _____  

Discover the new Windows Vista Learn more!
<http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE>  
Received on Tuesday, 29 May 2007 20:15:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:59 GMT