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

RE: Is +0 a nonPositiveInteger?

From: James Clark <jjc@jclark.com>
Date: Sat, 27 Apr 2002 08:11:51 +0700
To: Ashok Malhotra <ashokma@microsoft.com>, noah_mendelsohn@us.ibm.com
cc: XML Schema Comments <www-xml-schema-comments@w3.org>
Message-ID: <1035043934.1019895111@[]>

> I'm sorry you are troubled but consider this case.
> <xsd:simpleType name="myTime">
>   <xsd:restriction base="xsd:dateTime">
>     <xsd:pattern
> value="[0-9]{2}:[0-9]{2}:[0-9]2.[0-9]*(Z|[+-]?[0-9]{2}:[0-9]{2})?."/>
>   </xsd:restriction>
> </xsd:simpleType>
> What is the value space and lexical spece of the derived type and how
> are they related?

I would make a couple of observations here:

- Defining a data type requires not just defining the lexical and value 
spaces, but also defining the mapping from the lexical space to the value 
space.  There's no way in XML Schema for a user to specify a new 
lexical-to-value space mapping.   The only lexical-to-value-space mappings 
available are those associated with the builtin primitive types. The 
lexical-to-value-space mapping of the derived type is always the 
lexical-to-value-space mapping of the base type.

- Specifying a derived type with a pattern facet does NOT specify that the 
lexical space of the derived type is equal to the set of strings matched by 
the pattern regex.  Rather it specifies that the lexical space is the 
intersection of that set of strings with the lexical space of base type. 
This ensures that the lexical space of the derived type is always a subset 
of the lexical space of the base type, which in turn guarantees that the 
lexical-to-value-space mapping of the base type remains suitable for the 
derived type.

Received on Friday, 26 April 2002 21:09:37 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:50:00 UTC