[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Handling the enumeration facet

From: Klaas Dellschaft <klaasd@uni-koblenz.de>
Date: Fri, 31 Dec 2004 17:29:11 +0100
Message-ID: <008501c4ef55$dd6aa930$c301a8c0@MorningSun>
To: "Michael Kay" <mike@saxonica.com>, "'George Cristian Bina'" <george@oxygenxml.com>, "'Xan Gregg'" <xan.gregg@jmp.com>
Cc: <xmlschema-dev@w3.org>
enumeration facets

> I would expect this too, but I don't think it's what the spec says. In
> 3.3.4, Validation Rule: Element Locally Valid, it implies that <test
> xsi:type="xs:string">10</test> is valid if 10 is a valid xs:string (which 
> it
> is), provided that xs:string is validly derived from s2 (which it is). I
> can't see anything in the rules that causes the enumeration facet to be
> checked.

Ah, I understand. So xsi:type doesn't change the order of evaluation of a 
union's member types (as it is said in ยง2.5.1.3 of XML Schema Part 2) but 
instead the value is validated against the given type (if it is a member 
type of the union).

This means that the constraining facets of the union are circumvented by the 
usage of xsi:type. Also <test xsi:type="xs:integer">540</test> would be 
perfectly valid. So using xsi:type for union types can make instance 
documents valid which wouldn't be valid otherwise. The allowed document set 
isn't further restricted but extended.

Thank you, that helped me. So both tools are correct: The tool which only 
has the integer "10" in the value space of the union type and also the tool 
which successfully validates <test xsi:type="xsd:string">10</test>. But I 
would agree that it isn't reasonable because it contradicts the general 
philosophy followed in validation against simple types (which in all other 
cases only allows a restriction).

Cheers
Klaas 
Received on Friday, 31 December 2004 16:29:17 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.