List Info

Thread: Problem validating regexp.




Problem validating regexp.
user name
2007-04-13 18:47:35
Hi All,

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

 &nbsp;  <xs:simpleType name=";function_name_t">
   ;  &nbsp;  <xs:restriction base=";xs:string&quot;>
&nbsp;    &nbsp;   &nbsp;  <xs:pattern value=&quot;[a-zA-Z0-9][a-zA-Z0-9s_-.']{0,30}[a-zA-Z0-9]";/>
&nbsp; &nbsp;  &nbsp;  </xs:restriction&gt;
 &nbsp;  </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.&nbsp; Certain chars such
as underscores and spaces are OK in the middle however.

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

Any ideas what is wrong?


Re: Problem validating regexp.
country flaguser name
United States
2007-04-13 19:45:59
fred basset wrote:
> 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-9s_-.']{0,30}[a-zA-Z0-9]&
quot;/>
>         </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?

See htt
p://bugzilla.gnome.org/show_bug.cgi?id=425542.  Should
be fixed in
SVN.

Bill


_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )