xml - JAXB @XmlAnyElement ignoring CDATA -
xml - JAXB @XmlAnyElement ignoring CDATA -
our application working fine till encountered cdata section in incoming xml. know cdata in xml quite mutual case. how forgot it. using jaxb mapping in next way
@xmlrootelement(name="myroot") @xmlaccessortype(xmlaccesstype.field) public class myroot { @xmlelement(name="one") private string one; @xmlelement(name="three") private string three; @xmlanyelement private list<object> remaining = new arraylist<object>(); public myroot() { } } i receive next xml application. didn't understand why jaxb ignoring cdata in /myroot/two/bla2/one. after transformation see output <two><bla><bla> <bla2><one> function matchwo(a,b) { if (a < b && < 0) { homecoming 1;} else { homecoming 0;}} </one></bla2> <two> (notice there no cdata)
<myroot> <one></one> <two> <bla></bla> <bla2><one><![cdata[ function matchwo(a,b) { if (a < b && < 0) { homecoming 1;} else { homecoming 0;}} ]]></one></bla2> </two> <three></three> <four>some text</four> please help me understand issue. missing cdata? in advance.
xml jaxb cdata
Comments
Post a Comment