- From: Jeff Dahl <jddahl@micron.com>
- Date: Fri, 09 Apr 2004 15:57:45 -0600
- To: xmlschema-dev@w3.org
Given the following XML segment: <foos> <foo id="1490" name="myName"/> <foo id="9091" name="myNAME"/> </foos> shouldn't a uniqueness constraint: <xsd:element name="foos"> <xsd:complexType> <xsd:sequence> <xsd:element name="foo" type="foo_type" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> <xsd:unique name="name_id"> <xsd:selector xpath="foo"/> <xsd:field xpath="@name"/> </xsd:unique> </xsd:element> throw an error? According to XML Schema Part 1: Structures: 4.1 *If *the {identity-constraint category} <http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#identity-constraint_name> is /unique/, *then *no two members of the ·qualified node set· <http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-qns> have ·key-sequences· <http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-ks> whose members are pairwise equal, as defined by Equal <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes#equal> in [XML Schemas: Datatypes] <http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#ref-xsp2>. where Equal is: 4.2.1 equal Every ·value space· <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#dt-value-space> supports the notion of equality, with the following rules: * for any /a/ and /b/ in the ·value space· <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#dt-value-space>, either /a/ is equal to /b/, denoted /a = b/, or /a/ is not equal to /b/, denoted /a != b/ * there is no pair /a/ and /b/ from the ·value space· <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#dt-value-space> such that both /a = b/ and /a != b/ * for all /a/ in the ·value space· <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#dt-value-space>, /a = a/ * for any /a/ and /b/ in the ·value space· <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#dt-value-space>, /a = b/ if and only if /b = a/ * for any /a/, /b/ and /c/ in the ·value space· <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#dt-value-space>, if /a = b/ and /b = c/, then /a = c/ * for any /a/ and /b/ in the ·value space· <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#dt-value-space> if /a = b/, then /a/ and /b/ cannot be distinguished (i.e., equality is identity) Shouldn't unique be case-sensitive? Thanks, Jeff Dahl
Received on Friday, 9 April 2004 17:58:32 UTC