Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Problem with xsd and xml validation using JAXB(InvalidRegex:Pattern value '([a-zA-Z0-9\_\.\*\%\-]){1,28}' is not a valid regular expression. The reported error was: 'This expression is not supported in the current option setting.')
Problem with xsd and xml validation using JAXB [message #809163] Tue, 28 February 2012 14:53 Go to next message
Manoj Kumar is currently offline Manoj Kumar
Messages: 1
Registered: February 2012
Junior Member
Hi,
I am validating the xml file with xsd. I am getting a problem when there is a regular expression which contains the escape characters
For example
my xsd is like :
<xs:simpleType name="DestinationStringLimitedType">
<xs:restriction base="xs:string">
<xs:pattern value="([a-zA-Z0-9\_\.\*\%\-]){1,28}"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>

when i am trying to validate using jaxb i'm getting the error as

Pattern value '([a-zA-Z0-9\_\.\*\%\-]){1,28}' is not a valid regular expression. The reported error was: 'This expression is not supported in the current option setting.'

And when i remove the escape characters it is not giving any errors that is if the xsd is <xs:pattern value="([a-zA-Z0-9_.*%-]){1,28}"/> .

1) How to make JAXB work with this regular expression(with escape characters)?
2) How to configure Xerces to make it parse this regular expression?


Can any one help me with the above problem ?
Re: Problem with xsd and xml validation using JAXB [message #809223 is a reply to message #809163] Tue, 28 February 2012 16:04 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26126
Registered: July 2009
Senior Member
Manoj,

This newsgroup is for asking questions about Eclipse's XSD model APIs,
not a general XML Schema newsgroup. More comments below.

On 28/02/2012 3:53 PM, Manoj Kumar wrote:
> Hi,
> I am validating the xml file with xsd. I am getting a problem when
> there is a regular expression which contains the escape characters
> For example
> my xsd is like :
> <xs:simpleType name="DestinationStringLimitedType">
> <xs:restriction base="xs:string">
> <xs:pattern value="([a-zA-Z0-9\_\.\*\%\-]){1,28}"/>
I don't believe you need to escape characters in a character group.
> <xs:whiteSpace value="collapse"/>
> </xs:restriction>
> </xs:simpleType>
>
> when i am trying to validate using jaxb i'm getting the error as
>
> Pattern value '([a-zA-Z0-9\_\.\*\%\-]){1,28}' is not a valid regular
> expression. The reported error was: 'This expression is not supported
> in the current option setting.'
>
> And when i remove the escape characters it is not giving any errors
> that is if the xsd is <xs:pattern value="([a-zA-Z0-9_.*%-]){1,28}"/> .
>
> 1) How to make JAXB work with this regular expression(with escape
> characters)?
I don't think you need then and I don't think they're allowed.
> 2) How to configure Xerces to make it parse this regular expression?
If the expression is valid, Xerces will like it, otherwise you'll get an
error. There's no avoiding that.
>
> Can any one help me with the above problem ?
Previous Topic:xpath error
Next Topic:Include several XSD files
Goto Forum:
  


Current Time: Tue Oct 21 02:15:51 GMT 2014

Powered by FUDForum. Page generated in 0.01625 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software