You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Gregory Khanlarov <gr...@coretek.com> on 2004/03/02 20:02:10 UTC
Regular expressions in Schema 'pattern' facet
Hi,
I have a question related to regular expressions parser in Xerces.
I am using Sun's JAXB compiler from the Java Web Services Developer's Pack
version 1.3. As far as I understand, JAXB uses Xerces when it processes an
XML Schema. I have simple type defined with a pattern facet:
<xs:simpleType name="IpAddressType">
<xs:restriction base="xs:string">
<xs:pattern
value="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[
0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[0
1]?[0-9][0-9]?)\b" />
</xs:restriction>
</xs:simpleType>
The ANT build process fails with the following error message:
[xjc] [ERROR] InvalidRegex: Pattern value '\b(25[0-5]|2[0-4][0-9]|[01]?[0-
9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]
?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b' is not a valid
regular expression. The reported error was: 'This expression is not
supported in the current option setting.'
I guess the string "This expression is not supported in the current option
setting." comes from Xerces code. I know that there is a way to
programmatically configure RegularExpression class to customize the
processing of regular expressions.
My questions are:
How to make JAXB work with this regular expression?
How to configure Xerces to make it parse this regular expression?
Please CC to greg@coretek.com your reply
Thank you very much,
Gregory
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org