Semantic of the unique/key/keyref constraints.

Given the definition:

<xs:element name="foo">
 ...
 <xs:unique name="uniqueFoo">
   <xs:selector xpath="bar"/>
   <xs:field xpath="id"/>
 </xs:unique>
</xs:element>

my understanding of the rec is that this can be read in plain english as
"in each element foo, the sub elements bar identified by their id must
be unique".

In particular, the following paragraphs of part one: 

"{fields} specifies XPath expressions relative to each element selected
by a {selector}. This must identify a single node (element or attribute)
whose content or value, which must be of a simple type, is used in the
constraint. It is possible to specify an ordered list of {fields}s, to
cater to multi-field keys, keyrefs, and uniqueness constraints. "

and 

"For each node in the ·target node set· all of the {fields}, with that
node as the context node, evaluate to either an empty node-set or a
node-set with exactly one member, which must have a simple type."

let me think that each of the fields must identify a unique (or non
existing) node in the context of each occurrence of a selector.

If my interpretation is right, isn't it contrary to the example of
composed key given in the primer:

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

where the field "r:part/@number" is pointing to 4 different nodes in
this case:

<regions>
 <zip code="95819">
  <part number="872-AA" quantity="1"/>
  <part number="926-AA" quantity="1"/>
  <part number="833-AA" quantity="1"/>
  <part number="455-BX" quantity="1"/>
 </zip>
...

Thanks to let me know what I have wrong (or to confirm my
understanding;) ) !

Eric  
-- 
Pour y voir plus clair dans la nebuleuse XML...
                                          http://dyomedea.com/formation/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------

Received on Monday, 18 June 2001 12:36:31 UTC