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


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.*"/>

What will be the canonical lexical representation for the following value?

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?

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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:13 UTC