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">
  <sequence>
   <element name="Fact" type="fac:FactType" maxOccurs="unbounded">
    <unique name="factID">
     <selector xpath="Fact"/>
     <field xpath="UniqueID"/>
    </unique>
   </element>
  </sequence>
 </complexType>
 
 <complexType name="FactType">
  <sequence>
   <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"/>
  </sequence>
 </complexType>


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

Joe
Received on Sunday, 21 April 2002 01:16:33 GMT

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