Jaxb conversion of number with comma as a decimal separator

Viewed 3721

I am using Jaxb to parse xml. In the xml file I have list of items defined as follows:

<item>
   <currency_name>US Dollar</currency_code>
   <currency_code>USD</currency_code>
   <rate>3,0223</rate>
</item>

When I put in my xsd file the following line:

<xsd:element name="rate" type="xsd:string" minOccurs="1" maxOccurs="1"/>

I get 3,0223 as a string value, however when I put:

<xsd:element name="rate" type="xsd:double/BigDecimal/float" minOccurs="1" maxOccurs="1"/>

then I recieve 0.0/null. I think that the problem is in the "," separator. How to unmarshall rate value to BigDecimal?

1 Answers
Related