Problem with xsd and xml validation using JAXB [message #809163] |
Tue, 28 February 2012 09:53  |
Eclipse User |
|
|
|
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 11:04  |
Eclipse User |
|
|
|
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 ?
|
|
|
Powered by
FUDForum. Page generated in 0.09608 seconds