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

Re: question about unique and xpath

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 20 Jun 2001 14:59:21 +0100
To: "Uwe Zeise" <uwezeise@yahoo.de>
Cc: <www-xml-schema-comments@w3.org>
Message-ID: <f5bg0cv8d6u.fsf@cogsci.ed.ac.uk>
"Uwe Zeise" <uwezeise@yahoo.de> writes:

> Hi folks,
> 
> How can I achieve via "unique" that the element "id" is unique within the whole document ?
> 
> <root>
>   
>  <postition>
>     <id>100</id>
>   </postition>
>   <postion>
>     <id>101</id>
>   </postion>
>  
>   <anotherpostion>
>     <dummy>
>       <id>102</id>
>     </dummy>
>   </anotherposition>
> 
> </root>
>      
> XML-Schema:
> 
> <element name="root">
   <snip/>
>     <unique name="idMustBeUnique">
>       <selector xpath=".//id"/>    <------------- Is that one correct ?
>       <field       xpath="."/>
>     </unique>
>   </element>

Looks right to me.

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 Wednesday, 20 June 2001 09:59:20 GMT

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