String patterns in schema

A

Ashton

I have the following in my schema file

<!-- =========== -->
<xs:simpleType name="TextSubjectString">
<xs:annotation>
<xs:documentation>String data.</xs:documentation>
</xs:annotation>
<xs:restriction base="UsAsciiPrintableString">
<xs:minLength value="1"/>
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>

<!-- =========== -->
<xs:simpleType name="UsAsciiPrintableString">
<xs:annotation>
<xs:documentation>Unformatted text.</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[\p{IsBasicLatin}-[\p{C}]]*"/>
</xs:restriction>
</xs:simpleType>
<!-- =========== -->

It looks to me that this should accept pretty much any string between
1 and 20 characters that doesnt contain characters that are invalid in
XML 1.0 name. However, MSXML4.0 validation fails anything that isn't
exactly one character long. XMLSpy validates the way I thought it
would. Any idea why it works in Spy and not MSXML4.0?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top