Case-insensitive xs:unique?

I have this in my schema file:

<xs:element name="ListOfNames">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="CaseInsensitiveName"
       minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>
   <xs:unique name="UniqueNames">
     <xs:selector xpath="CaseInsensitiveName"/>
     <xs:field xpath="text(.)"/>
   </xs:unique>
</xs:element>

<xs:element name="CaseInsensitiveName">
   <xs:simpleType>
     <xs:restriction base="xs:string">
       <xs:minLength value="1"/>
       <xs:maxLength value="24"/>
     </xs:restriction>
   </xs:simpleType>
</xs:element>


and this in my instance document:

<ListOfNames>
   <CaseInsensitiveName>John</CaseInsensitiveName>
   <CaseInsensitiveName>Fred</CaseInsensitiveName>
   <CaseInsensitiveName>fred</CaseInsensitiveName>
</ListOfNames>

Using:

xmlns:xs="http://www.w3.org/2001/XMLSchema" and
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

This validates, unless I add a second "Fred" when the case-sensitive  
unique constraint kicks in.

But is there a way to make the unique constraint case-insensitive, so  
that the example above is invalid because both "Fred" and "fred" are  
present?

Received on Sunday, 22 May 2005 10:12:26 UTC