On Tue, Jun 07, 2011 at 10:05:24PM +0200, Andreas L. Delmelle wrote:
> On 07 Jun 2011, at 17:43, Vincent Hennebert wrote:
> 
> > I’m a bit at a loss to understand why Gump has suddenly started to throw
> > this error. The tests run fine on my local copy, both with a Sun and an
> > OpenJDK jvm. Could that be that the version of the Xerces library used
> > by Gump is not up-to-date? But then, why would that have worked before?
> > Any ideas?
> 
> Puzzles me as well. At first, I suspected the problem might just be that Gump 
> uses a more up-to-date Xerces than the one distributed with FOP. We still 
> have 2.7.1 in the lib directory, while the latest available release is 2.11. 
> Then again, that version was released over 6 months ago...?
> 
> >    [junit] java.lang.reflect.InvocationTargetException
> >    [junit] Caused by: java.lang.ExceptionInInitializerError
> >    [junit]  at 
> > org.apache.fop.intermediate.AbstractIFTestCase.<clinit>(AbstractIFTestCase.java:80)
> >    [junit]  at 
> > org.apache.fop.intermediate.IntermediateFormatTestSuite.suite(IntermediateFormatTestSuite.java:63)
> >    [junit] Caused by: org.xml.sax.SAXParseException: InvalidRegex: Pattern 
> > value '\((solid|dotted|dashed|double|groove|ridge|inset|outset),.+)' is not 
> > a valid regular expression. The reported error was: 'Wrong character.'.
> 
> 
> Could this point to a quirk in util.regex, or its use in the XML Schema 
> implementation in the version of Open JDK that Gump is compiling with? 
> At any rate, the starting '\(' does indeed seem to be an invalid escape 
> sequence (Shouldn't it be '\\(' if it needs to match a literal bracket?) 
> It is present as-is, on our end in 
> src/documentation/intermediate-format-ng/fop-intermediate-format-ng-datatypes.xsd.
>  I am not an XML Schema expert, but that pattern does seem to be odd. Not 
> sure why the leading backslash is needed...
> 
> That file hasn't changed in over 2 years, though. :-/

'\(' in the pattern is valid and indicates a literal '('. The pattern
as a whole is invalid, but in lax validation the final ')' is ignored.

The value in the test is '(solid,#000000,5000)', and the valid pattern
for it is '\(...\)'. In lax validation the final ')' is subsumed in
the pattern '.+'.

I believe that gump uses current builds of Xerces, and it seems that
the validation in Xerces has been made stricter.

I committed a fix.

Simon

Reply via email to