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 Simon Čarni <sc...@siol.net> on 2005/12/22 13:11:22 UTC
InvalidRegex pattern???
Hi all!
When trying to validate XML document against a schema using SAX parser and xercex 2.6.2 jar I get following error:
[InvalidRegex: Pattern value '[0-9][0-9][0-9][0-9][0-9][-][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' is not a valid regular expression: ''-' is an invalid character range. Write '\-'.'.]
Running same code using xerces jar shipped with Websphere Studio Application Developer 5.1 work fine. Any idea?
Thanks in advance,
cheers, Simon
Re: InvalidRegex pattern???
Posted by George Cristian Bina <ge...@sync.ro>.
> [InvalidRegex: Pattern value
>
'[0-9][0-9][0-9][0-9][0-9][-][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
--------------------------^^^
You should escape '-' as '\-'
See
http://www.w3.org/TR/xmlschema-2/#nt-SingleCharEsc
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Simon Čarni wrote:
> Hi all!
>
> When trying to validate XML document against a schema using SAX parser
> and xercex 2.6.2 jar I get following error:
>
> [InvalidRegex: Pattern value
> '[0-9][0-9][0-9][0-9][0-9][-][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
> is not a valid regular expression: ''-' is an invalid character range.
> Write '\-'.'.]
>
> Running same code using xerces jar shipped with Websphere Studio
> Application Developer 5.1 work fine. Any idea?
>
> Thanks in advance,
>
> cheers, Simon
---------------------------------------------------------------------
To unsubscribe, e-mail: j-users-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-users-help@xerces.apache.org