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

Question about uniqueness

From: odwl <odwl@mac.com>
Date: Tue, 10 Sep 2002 09:02:04 -0400 (EDT)
Cc: Olivier De Wolf <olivier.dewolf@n-side.be>
To: xmlschema-dev@w3.org
Message-Id: <7624FE1A-C4BD-11D6-96E5-0003938232DE@mac.com>

Here is an XML document :

<?xml version="1.0" encoding="ISO-8859-1"?>
<Site xmlns="http://n-side/site/ssShema"
<Home name="CorHome">
		<Topic name="Your_Needs">
			<View name="Choice_1"/>
			<View name="CorHome"/>
			<View name="Your_Needs2"/>
		<Topic name="Your_Needs2">
			<View name="Choice_3"/>
			<View name="Choice_4"/>
			<View name="Choice_3"/>
		<Topic name="Your_Needs"/>

I would like to have a schema that enforces the uniqueness of all the 
"name" attributes (for Home, Topic and View elements). The above 
document is thus not valid (at all).

I inserted the following XML Schema fragment within the Site element 

		<unique name="idName">		
			<selector xpath=".//*"/>
			<field xpath="@name"/>

But it is not working : there is no validation error for the above 

Note that with the following fragment, it's OK, I have an error because 
of "Choice_3" appearing twice.

		<unique name="idName">		
			<selector xpath=".//View"/>
			<field xpath="@name"/>

and I have the uniqueness of the name in all the View pages

Do I miss something,

Thanks in advance

Received on Tuesday, 10 September 2002 17:22:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:05 UTC