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

前端 未结 5 736
無奈伤痛
無奈伤痛 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:30

    Depending on what you are exactly looking for you can either :

    • disable character escaping
    • or use CDATA string which support can be added into JAXB with just a bit of configuration

提交回复
热议问题