Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML schema - case-insensitive xs:unique? - newbie question

Reply
Thread Tools

XML schema - case-insensitive xs:unique? - newbie question

 
 
robin.guest@gmail.com
Guest
Posts: n/a
 
      05-22-2005
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="."/>
</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:

xmlnss="http://www.w3.org/2001/XMLSchema" and
xmlnssi="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?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
XML Schema to XML Schema Conversion Hari Om XML 1 03-02-2004 09:04 PM
XML schema regular expressions question and recommended XML Schema book Fred Smith XML 1 02-05-2004 11:12 AM



Advertisments