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

Re: [Moderator Action] Re: [Moderator Action] Key/Keyref definition

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 16 Apr 2001 10:41:39 +0100
To: "Ravindra Jain" <ravindra@ltp.soft.net>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5by9t1yyek.fsf@cogsci.ed.ac.uk>
"Ravindra Jain" <ravindra@ltp.soft.net> writes:

> Thanks for help..
> But again I've some confusion in the para 3.10 of XML Schema : Part 1
> Structures
> in clauses 1.1-1.3 of Validation Rule: Identity-constraint Satisfied clause
> 
> Particularly what does the clause 1.3 means :
> "
> 1.3 :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. [Definition:]  Call the sequence of the values (as
> defined in [XML Schemas: Datatypes]) of those node-sets in order the
> key-sequence of the node"
> 
> here how to interpret "evaluate" ?
> and what will be the target node-set for following code ?
> 
> <element name="BookCatalogue">
>   <complexType>
>      <sequence>
>      <element name="Book" minOccurs="0" maxOccurs="unbounded">
>       <complexType>
>        <sequence>
>        <element name="Title" type="string" minOccurs="1" maxOccurs="1"/>
>        <element name="Author" type="string" minOccurs="1" maxOccurs="1"/>
>        <element name="Date" type="string" minOccurs="1" maxOccurs="1"/>
>        <element name="ISBN" type="string" minOccurs="0" maxOccurs="1"/>
>        <element name="Publisher" type="string" minOccurs="1" maxOccurs="1"/>
>        </sequence>
>       </complexType>
>      </element>
>     </sequence>
>   </complexType>
>   </element>
> <element name="someElement"..>
>   .....
>  <key name="UNIQ">
>    <selector xpath="BookCatalogue\Book"/>
>    <field xpath="ISBN"/>
>  </key>
>   .......

Assuming BookCatalogue is a daughter of someElement, and that you
replace BookCatalogue\Book with BookCatalogue/Book,
every 'someElement' in your instance will have as its target node set
the set of all its Book grandchildren.  The Book elements with an ISBN
child will have it value as their key -- the others will be in error.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Monday, 16 April 2001 05:42:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:20 GMT