W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

Re: Problem with UNIQUE constraint

From: Gary Cramblitt <garycramblitt@comcast.net>
Date: Wed, 27 Mar 2002 19:29:51 -0500
To: xmlschema-dev@w3.org
Message-id: <3CA21DAF.17525.227275@localhost>
On 27 Mar 2002 at 12:48, Jeni Tennison wrote:

> By the way, I think that you're probably using the identity constraint
> incorrectly. If you want to test that each Rec_SelRadioSrvc element
> has a unique combination of LineID and RadioService, then you need to
> place the identity constraint on the declaration of the element that's
> the *parent* of the Rec_SelRadioServc element, as follows:
>   <xs:unique name="ID_SelRadioSrvc">
>     <xs:selector xpath="Rec_SelRadioSrvc"/>
>     <xs:field xpath="LineID"/>
>     <xs:field xpath="RadioService"/>
>   </xs:unique>
> As you currently have it, all you're testing is that the LineID and
> RadioService of one Rec_SelRadioSrvc at a time. There isn't much point
> doing that unless you're using the identity constraint sneakily to
> test a co-occurrence constraint, which I don't think is the case here.

Yes, you are quite right.  I need to change the selector xpath to "*".

Received on Wednesday, 27 March 2002 19:30:32 UTC

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