W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Re: key constraints mechanism too weak?

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Fri, 05 Oct 2001 16:15:00 +0200
Message-ID: <3BBDC064.5070003@dyomedea.com>
To: Gary Robertson <gazinyork@hotmail.com>
Cc: xmlschema-dev@w3.org
Gary Robertson wrote:

> I want the name attribute of an element and the name attribute
> of one of its (multiple instance) child elements to form a unique
> key. I would have though this a fairly simple requirement but
> it is rejected because one of the two fields evaluates to more
> than one node.
> Am I missing something? Does anybody know the right way for
> me to meet my requirement?

No, I don't think you're not missing anything (and the example in the 
schema primer is bogus).

The closer you can go to what you need is to define 2 keys: a first one 
"Object" under "Repository" and the second one on "State" in the scope 
of "Object".

This will do the job of checking that your values a uniques keys in 
their respective contexts, but you won't be able to reference the 
concatenation of the 2 keys.

Hope this helps.


Rendez-vous  Paris pour une visite guidee de la nebuleuse XML.
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
Received on Friday, 5 October 2001 10:14:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:54 UTC