![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - Re: Relaunched and expanded XML Schema Test Collection >Thread Next - Creating library schemas which only expose a single document element Case-insensitive xs:unique?To: xmlschema-dev@--.--- Date: 5/22/2005 1:58:00 AM
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?
From 32767@d... Sun May 22 10:21:44 2005
Received: from lisa.w3.org ([1 | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
