users@jaxb.java.net

Re: Regular Expression

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 14 May 2007 16:56:18 -0700

This part of the error check comes from JAXP. I don't really know
whether the JAXP RI is right or XHTML schema is right, but the regex
code originates from the IBM folks who know what they are doing, so I
tend to believe that it's correct.

In any case, you can work around the problem by using the '-nv' option.

Hanson Char wrote:
> Fix the wrong subject line....
>
> On 4/19/07, Hanson Char <hanson.char_at_gmail.com> wrote:
>> When I tried to use XJC (2.1.3) against the schema:
>>
>> http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd
>>
>> I got the error below. It seems XJC is mis-interpreting the regular
>> expression ?
>>
>> Hanson Char
>>
>> compile:
>> [echo] Compiling the schema...
>> [mkdir] Created dir: c:\Playground\jaxb-ri\20070413\samples\xhtml\gen-src
>> [xjc] c:\Playground\jaxb-ri\20070413\samples\xhtml\gen-src\test
>> is not found and thus excluded from the dependency check
>> [xjc] Compiling
>> file:/c:/Playground/jaxb-ri/20070413/samples/xhtml/xhtml1-strict.xsd
>> [xjc] [ERROR] InvalidRegex: Pattern value
>> '[-+]?(\d+|\d+(\.\d+)?%)' is not a valid regular expression. The
>> reported error was: ''-' is an invali
>> d character range. Write '\-'.'.
>> [xjc] line 219 of
>> file:/c:/Playground/jaxb-ri/20070413/samples/xhtml/xhtml1-strict.xsd
>> [xjc]
>> [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
>> file:/c:/Playground/jaxb-ri/20070413/samples/xhtml/xhtml1-strict.xsd
>> [xjc]
>> [xjc] [ERROR] InvalidRegex: Pattern value
>> '[-+]?(\d+|\d+(\.\d+)?%)(,\s*[-+]?(\d+|\d+(\.\d+)?%))*' is not a valid
>> regular expression. The reporte
>> d error was: ''-' is an invalid character range. Write '\-'.'.
>> [xjc] line 265 of
>> file:/c:/Playground/jaxb-ri/20070413/samples/xhtml/xhtml1-strict.xsd
>> [xjc]
>> [xjc] failure in the XJC task. Use the Ant -verbose switch for
>> more details
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com