W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2003

Re: Unions: canonical lexical representation

From: <noah_mendelsohn@us.ibm.com>
Date: Thu, 20 Nov 2003 17:12:13 -0500
To: "Alessandro Triglia" <sandro@mclink.it>
Cc: "[XML Schema Comments]" <www-xml-schema-comments@w3.org>, www-xml-schema-comments-request@w3.org, "[Public XML Schema-DEV]" <xmlschema-dev@w3.org>
Message-ID: <OFFF192331.CDC2F7B5-ON85256DE4.00798466@lotus.com>

There are others more expert in this than I, but wouldn't the same be true 
of an integer declared with 

        <xsd:pattern value="0\d"/>

in other words, an integer with required leading zero?  There is no 
canonical form of any value in the value space of this type, which is a 
known result of the fact that schema allows potentially constraints in the 
lexical domain.  I don't think you need a union to see this effect.

Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142

"Alessandro Triglia" <sandro@mclink.it>
Sent by: www-xml-schema-comments-request@w3.org
11/10/2003 05:16 PM

        To:     "[Public XML Schema-DEV]" <xmlschema-dev@w3.org>, "[XML Schema Comments]" 
        cc:     (bcc: Noah Mendelsohn/Cambridge/IBM)
        Subject:        Unions: canonical lexical representation


Suppose you have a union whose members are:

- a restriction of xsd:string with a length facet = 1
- xsd:integer

Suppose the union is used as the type definition of an attribute 
declaration with default = "01"

This "01" does not match the first member of the union but matches the 
second member.  Therefore it is the lexical representation of an 
xsd:integer.  But its canonical lexical representation will be "1".  "1" 
(and not "01") will be added to the PSVI as the value of a missing 
attribute i.i. corresponding to that attribute declaration.

I would accept the statement that the attribute declaration *component* 
has a correct value for the default property ("the integer 1"), but when 
this value is written into the PSVI, the result will be wrong.

Alessandro Triglia
OSS Nokalva
Received on Thursday, 20 November 2003 17:20:27 UTC

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