Handling XML escape characters (e.g. quotes) using JAXB Marshaller

前端 未结 5 750
無奈伤痛
無奈伤痛 2020-12-01 21:47

I need to serialize an XML java object to a XML file using the JAXB Marshaller (JAXB version 2.2). Now in the xml object, I have a tag which contains String value

5条回答
  •  误落风尘
    2020-12-01 22:32

    Done it by setting the following property for the JAXB Marshaller:

    marshaller.setProperty("jaxb.encoding", "Unicode");
    

提交回复
热议问题