I'm using Xerces-J 1.3.1, and I noticed an interesting anomaly when working
with regular expressions in a pattern facet yesterday. I was trying to
create a pattern that would match either an empty element or a string
element in a specific format, like this:
<contact:fax>+1.7034444444</contact:fax> or <contact:fax/>
This pattern seems to work:
<pattern value="(\+[0-9]{1,3}\.[0-9]{1,12})|.{0,0}"/>
This one (switching the order of the choices) doesn't:
<pattern value=".{0,0}|(\+[0-9]{1,3}\.[0-9]{1,12})"/>
>java sax.SAXCount -v foo.xml
[Error] foo.xml:23:52: Datatype error: In element 'contact:fax' : Value
'+1.7034444444' does not match regular expression facet
'.{0,0}|(\+[0-9]{1,3}\.[0-9]{1,12})'..
foo.xml: 1231 ms (22 elems, 5 attrs, 273 spaces, 108 chars)
>
Why is the order of these choices significant?
<Scott/>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]