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

Canonical lexical representation of a value for a type derived by restriction

From: George Cristian Bina <george@oxygenxml.com>
Date: Tue, 21 Aug 2007 17:41:57 +0300
Message-ID: <46CAF9B5.3090200@oxygenxml.com>
To: xmlschema-dev@w3.org

Hi,

I have difficulties to find in the XML Schema specification how the 
canonical lexical representation for a value from a type derived by 
restriction is computed.
Let's consider an example. We have a type derived from duration that 
restricts duration to allow only values that match some pattern:

<xs:simpleType name="ShortPositiveDuration">
   <xs:restriction base="xs:duration">
     <xs:pattern value="PT.*"/>
   </xs:restriction>
</xs:simpleType>

What will be the canonical lexical representation for the following value?
PT10H30M50.123S

Xerces for instance computes that taking into account the base type and 
it gets P0Y0M0DT10H30M50.123S as canonical lexical representation for 
the above value.
Is that right?
Or is the canonical lexical representation the same as the value 
PT10H30M50.123S in case of a restriction as above?

Thanks,
George
---------------------------------------------------------------------
George Cristian Bina - http://aboutxml.blogspot.com/
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Received on Tuesday, 21 August 2007 14:43:40 GMT

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