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

"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 UTC