W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2000

Re: [Moderator Action] [xmlschema-dev] <none>

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 21 Dec 2000 16:20:18 +0000
To: veronique.quiby@epfl.ch
Cc: xmlschema-dev@w3.org
Message-ID: <f5bg0jhyce5.fsf@cogsci.ed.ac.uk>
"Véro Quiby" <veroquiby@hotmail.com> writes:

> Hi,
> 
> I am working with xmlspy3.5 beta version.
> 
> This part my xmlschema validate:
> 
> <xsd:element name="Questionary">
> 	<xsd:complexType>
> 	....
> 	</xsd:complexType>
> 	<xsd:unique name="uniqueID">
> 		<xsd:selector xpath="QuestionAndAnswer"/>
> 		<xsd:field xpath="@id"/>
> 	</xsd:unique>
> </xsd:element>
> 
> <xsd:element name="QuestionAndAnswer">
> 	<xsd:complexType>
> 		....
> 		<xsd:attribute name="id" type="xsd:string" use="required"/>
> 
> 	</xsd:complexType>
> </xsd:element>
> 
> 
> 
> 
> My problem is when I instantiate an xml file for example:
> 
> <QuestionAndAnswer id="1" status="optional" visibility="visible">
> <Question> ....</Question>
> ......
> </QuestionAndAnswer>
> <QuestionAndAnswer id="1" status="required" visibility="visible">
> <Question> ....</Question>
> ......
> </QuestionAndAnswer>
> 
> This validate, and this is not what I want because I want unique ID's.
> What am I doing wrong ?

The <unique> declaration as you've placed it says

  'QuestionAndAnswer' elements are uniquely identified by their 'id'
   attribute within the scope of their containing 'Questionary' elements.

I don't see any 'Questionary' elements in your example -- are there
any, and if so where?

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 Thursday, 21 December 2000 11:20:25 GMT

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