W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2001

Error in example in section 5.1 of the Primer

From: Priscilla Walmsley <priscilla@walmsley.com>
Date: Wed, 17 Oct 2001 15:36:43 -0400
To: <www-xml-schema-comments@w3.org>
Message-ID: <001501c15743$2bd99670$b92a6420@xmls>
There is an error in the example of section 5.1 of the Primer (entitled "A
Unique Composed Value"):

<unique name="dummy1">
  <selector xpath="r:regions/r:zip"/>
  <field    xpath="@code"/>
  <field    xpath="r:part/@number"/>
 </unique>

The rules of identity constraints say that the field xpath should only
return one node for each node selected by the selector [1]. In this case, an
r:zip can contain many r:parts, each with their own number attribute.  This
violates the rule.

I don't think there's a valid way to express what the example is trying to
enforce.

Thanks,
Priscilla

[1] http://www.w3.org/TR/xmlschema-1/#cvc-identity-constraint

-----------------------------------------------------------
Priscilla Walmsley                   priscilla@walmsley.com
Vitria Technology                     http://www.vitria.com
Author, Definitive XML Schema    (Prentice Hall, Dec. 2001)
-----------------------------------------------------------
Received on Wednesday, 17 October 2001 15:38:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:57 GMT