Alex Rivera | Logout

How to prevent JAXB escaping a string

Asked 2010-07-20T10:26:40.080
15

I have an object, generated by XJC, called Product. I want to set product.currentPrice (a String) to be £210 where £ is the currency symbol (passed in from elsewhere in the system).

Trouble is, JAXB is escaping my ampersand, so it produces £210 instead. How do I make it not do this?

Edit
Report

1 Answer

0

How about using a CDATA section to wrap the value, and then use a JAXB implementation such as EclipseLink MOXy that can handle CDATA?

To handle CDATA using MOXy see:

answered 2010-07-20T14:52:13.127

Your Answer