users@jaxb.java.net

Re: InvalidRegex

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Tue, 10 Mar 2009 16:22:40 +0100

There's no problem with this pattern '[-+]...' with the xjc from JAXB 2.1.10
either.

However, if I do provoke an error (using '[[+-]...', for instance) the
wording of the error
message is significantly different:

[ERROR] InvalidRegex: Pattern value
'[[+-]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*' is not a valid regular expression.
The reported error was: ''[' is invalid in a character class. Write '\['.'
at column '1'.

Note the "...at column '1'!"

This leads me to believe that you aren't calling the xjc from 2.1.10. -
Check your ant/maven settings.

-W





On Tue, Mar 10, 2009 at 11:23 AM, Ferran Basora <fcsonline_at_gmail.com> wrote:

> Hi,
>
> I am working with version 2.1.10 available at https://jaxb.dev.java.net/
>
> JDK 1.5
>
> Any setting.
>
>
>
> On Mon, Mar 9, 2009 at 6:56 PM, Wolfgang Laun <wolfgang.laun_at_gmail.com>wrote:
>
>> The facet pattern is OK.
>>
>> However, I cannot reproduce this with the xjc that comes with
>> /usr/java/jdk1.6.0_11/bin/xjc,
>> which isn't the newest JAXB release either.
>>
>> Which JAXB version are you using? Any peculiar settings?
>> -W
>>
>>
>> On Mon, Mar 9, 2009 at 2:22 PM, Ferran Basora <fcsonline_at_gmail.com>wrote:
>>
>>> Hi,
>>>
>>> this is my first mail to this list.
>>>
>>> I have found a problem with JAXB and I don't now if its a bug or not.
>>>
>>> I have a XML with a XHTML namespace:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <root>
>>> <name>TESTname>
>>> <descripcion xmlns="http://www.w3.org/1999/xhtml">Pellentesque
>>> habitant <b>morbi tristique</b>senectus et netus et <b><i>malesuada</i></b>
>>> fames ac <u>turpis</u></descripcion>
>>> </root>
>>>
>>> And XSD with the include tag:
>>>
>>> <xs:import namespace="http://www.w3.org/1999/xhtml" schemaLocation="
>>> http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd" />
>>>
>>> But when I run the XJC task I get the errors bellow:
>>>
>>> [xjc] [ERROR] InvalidRegex: Pattern value '[-+]?(\d+|\d+(\.\d+)?%)'
>>> is not a valid regular expression. The reported error was: ''-' is an
>>> invalid character range. Write '\-'.'.
>>> [xjc] line 219 of
>>> http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
>>> [xjc] [ERROR] InvalidRegex: Pattern value
>>> '[-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*' is not a valid regular expression.
>>> The reported error was: ''-' is an invalid character range. Write '\-'.'.
>>> [xjc] line 230 of
>>> http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
>>> [xjc] [ERROR] InvalidRegex: Pattern value
>>> '[-+]?(\d+|\d+(\.\d+)?%)(,\s*[-+]?(\d+|\d+(\.\d+)?%))*' is not a valid
>>> regular expression. The reported error was: ''-' is an invalid character
>>> range. Write '\-'.'.
>>> [xjc] line 265 of
>>> http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
>>>
>>> Because a Pattern in XHTML defnition in
>>> http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd is not valid:
>>>
>>> <xs:restriction base="xs:string">
>>> <xs:pattern value="[-+]?(\d+|\d+(\.\d+)?%)|[1-9]?(\d+)?\*"/>
>>>
>>>
>>>
>>> </xs:restriction>
>>>
>>>
>>>
>>>
>>> Do you know a solution?
>>>
>>> Thanks!
>>>
>>
>>
>