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

uniqueness question

From: Joe Hallett <jhallett@mail.colgate.edu>
Date: Sun, 21 Apr 2002 01:21:19 -0400
Message-ID: <001801c1e8f4$60927600$6401a8c0@jhallett>
To: <xmlschema-dev@w3.org>
I am trying to specify that the contents of my "UniqueID" element is unqiue for every occurance of the element.

My problem is that the instance doc validates against the schema no matter what the contents of "UniqueID" are. When I enter identitcal values for each element, such as <UniqueID>a</UniqueID> and <UniqueID>a</UniqueID>, the instance doc is validated.  Obviously, I dont want this to happen.

Here is a portion of my schema:

<element name="Facts" type="fac:FactsType"/>
 <complexType name="FactsType">
   <element name="Fact" type="fac:FactType" maxOccurs="unbounded">
    <unique name="factID">
     <selector xpath="Fact"/>
     <field xpath="UniqueID"/>
 <complexType name="FactType">
   <element name="FactName" type="string"/>
   <!-- specifies the name of the fact -->
   <element name="UniqueID" type="string"/>
   <!-- a unique ID to distiguish facts with the same name -->
   <element name="Chaining" type="fac:ChainEnum"/>
   <!-- backwards chaining=back, forwards chaining=forward -->
   <element name="Slots" type="fac:SlotsType"/>

I would greatly appreciate any help.  Thank you!!!

Received on Sunday, 21 April 2002 01:16:33 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:56 UTC