I have an XML file that contains an element with special characters or escape characters in it. When I cancel this file to a Java object, JAXB automatically eludes these characters. However, I do not want them to be escaped, and the object should be populated with any value present in the XML file. A fragment of my XML file looks something like this:
<Order>
<name>Order One ></name>
<price>50</price>
<Order>
The My JAXB Order class is as follows:
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "Order")
public class Order{
@XmlElement
private String name;
@XmlElement
private String price;
In unmarshalling mode, the name of the class object of the class of the order is set to "Order one," while I want it to be "Order One, >" because this is a requirement.
CDATA, , XML, , , .
SO, '&' . .
Unmarshalling XML JAXB
JAXB . , , , , .
SO JAXB, .
.