java - How to prevent JAXB escaping a string -


I have an item, which is generated by the XJC, which is called product . I product.currentPrice (a string) to & amp; Amp; # X00A3; 210 where and amp; Amp; # X00A3; Currency symbols (passed from elsewhere in the system).

The problem is that, JAXB is avoiding my apersend, so it's and & amp; Amp; Amp; # X00A3; 210 instead of . How can I not do it?

By default, Marx implementation of JAXB usually escapes characters. To change this default behavior you must write a code that implements the com.sun.xml.bind.marshaller.CharacterEscapeHandler interface.

Set that handler in Marshall

CharacterExcecapHandler Escap Handler = NoSescopeHandler. These Instances; Marshaller.setProperty ("com.sun.xml.bind.characterEscapeHandler", Escap Handler);

You can look at the samples provided with the JACAB, character escape sample

.

Comments