Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Uniqueness and case sensitivity

From: Jeff Dahl <jddahl@------.--->
To: xmlschema-dev@--.---
Date: 4/9/2004 9:58:00 AM
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="unbounde=
d"/>
        </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 =B7qualified node set=B7 
<http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/#key-qns> have 
=B7key-sequences=B7 
<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 =B7value space=B7 
<http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#dt-val=
ue-space> 
supports the notion of equality, with the following rules:

    * for any /a/ and /b/ in the =B7value space=B7
      <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 =B7value space=B7
      <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 =B7value space=B7
      <http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#=
dt-value-space>,
      /a = a/
    * for any /a/ and /b/ in the =B7value space=B7
      <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 =B7value space=B7
      <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 =B7value space=B7
      <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

From gaytri_v@y...  Sat Apr 10 07:14:15 2004
Return-Path: <gaytri_v@y...>
X-Original-To: xmlsch


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent