Re: Regex problems with XMLBeans
"T. Allen" <[email protected]>
| Newsgroups | gmane.text.xml.axis.user |
|---|---|
| Message-ID | <[email protected]> |
Has anyone else had problems with regex using XML Beans binding? See
original message below. I have used the following regex with XML Beans
and it worked fine:
<xsd:pattern value="\d{10}|\d{3}\-d{7}" />
This regex gives an error every time:
<xsd:pattern value="^(NA|UN).*"/>
When validating this regex with XML Beans binding I get "string value
does not match pattern" error. Have I done something wrong or is this a
bug with XML Beans?
Thanks,
T
On 2/10/2014 12:40 PM, T. Allen wrote:
> I have an Axis2 1.6.1 web service that has 1 regex in the WSDL
> schema. The WSDL/schema snippet is below.
>
> <xsd:complexType name="hazmat">
> <xsd:sequence>
> <xsd:element minOccurs="0" name="hazmatCode" nillable="true"
> type="tns:hazmatCode"/>
> <xsd:element minOccurs="0" name="hazmatFlag" nillable="true"
> type="tns:hazmatFlag"/>
> </xsd:sequence>
> </xsd:complexType>
> <xsd:simpleType name="hazmatCode">
> <xsd:restriction base="xsd:string">
> <xsd:whiteSpace value="preserve"/>
> <xsd:pattern value="^(NA|UN).*"/>
> </xsd:restriction>
> </xsd:simpleType>
>
> I know the regex pattern of ^(NA|UN).* is valid as I have tested it.
> However, each time I send a request with a string that matches the
> pattern I get an error like "string value 'NA1122' does not match
> pattern" when performing validation against the schema.
>
> I have used simple patterns before with XMLBeans and they have worked
> fine. Have I defined the regex incorrectly or does the XMLBeans
> binding have problems with regex?
>
> Any and all information is appreciated.
>
> Thanks,
> T
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>