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

Restrictions on booleans

From: Robin Berjon <robin.berjon@expway.fr>
Date: Thu, 22 Aug 2002 15:37:49 +0200
Message-ID: <3D64E92D.2070508@expway.fr>
To: xmlschema-dev@w3.org

Hi,

xsd:boolean accepts the values "true", "false", "1", and "0". My reading 
of the spec would seem to indicate that the following is legal:

<restriction base='boolean'>
   <pattern value='true|false'/>
</restriction>

in order to model a language that has boolean types but only those two 
strings to flag truth (0 and 1 being illegal). My questions are: have I 
understood the spec correctly, and if so does that make much sense? It 
feels a bit strange having to use a pattern here, any reason why the 
equivalent enumeration isn't allowed?

Thanks,

-- 
Robin Berjon <robin.berjon@expway.fr>
Research Engineer, Expway
7FC0 6F5F D864 EFB8 08CE  8E74 58E6 D5DB 4889 2488
Received on Thursday, 22 August 2002 09:38:26 GMT

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