[xml] Problem validating regexp.



Hi All,

In my schema file I have a "function_name_t" type specified as :

    <xs:simpleType name="function_name_t">
        <xs:restriction base="xs:string">
            <xs:pattern value="[a-zA-Z0-9][a-zA-Z0-9\s_\-\.']{0,30}[a-zA-Z0-9]"/>
        </xs:restriction>
    </xs:simpleType>

I basically want to specify a function name as being at least two characters long, at most
32 chars long, but it cannot start or end with any non alpha, non numeric chars.  Certain chars such
as underscores and spaces are OK in the middle however.

I would have expected the string "aa" to pass validation with the above _expression_, but it does not.  I'm using
libxml2 version 2.6.26.  It does validate when I run the schema and XML file through XMLSpy however.

Any ideas what is wrong?




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]