Re: question about regex and schema

Thanks David,

I mixed up xs:enumeration an xs:pattern :-(

Andreas


Quoting dmaze@us.ibm.com:

> Andreas Peter <info@minimag.de> wrote on 02/29/2008 04:00:34 PM:
>
>>              <xs:element name="greek">
>>                  <xs:simpleType>
>>                      <xs:restriction base="xs:string">
>>                          <xs:enumeration value="\p{Greek}"/>
>>                      </xs:restriction>
>>                  </xs:simpleType>
>>              </xs:element>
>>
>> The aim should be to allow only greek characters inside an element
>> with the speccharType. But when I am going to test it inside an
>> instance document I only have the possibility to use the value
>> "\p{Greek}" instead of greek characters.
>
> Since you used <xs:enumeration> you've said "allow only xs:strings whose
> value is specifically '\p{Greek}'".  I think you were after the xs:pattern
> facet instead, e.g.
>
> <xs:pattern value="\p{IsGreek}*"/>
>
> The "*" in the pattern means "allow any number of Greek characters,
> possibly none"; without it you're allowing only a single character.  You
> also might consider \p{IsGreek}+ to require at least one character.
>
> David Maze
> Engineer, IBM WebSphere DataPower SOA Appliances
> One Rogers Street, Cambridge, MA 02142
> Phone: 617-693-1306  Fax: 617-693-5541

Received on Friday, 29 February 2008 21:20:35 UTC