java - Retrieve value from CDATA -
i using java(jaxb) , want retrieve data cdata
<![cdata[need help]]>
desired output
need
can body me out. tried several solutions.
thanks!!
try this
@xmlaccessortype(xmlaccesstype.field) public class test0 { string e1; public static void main(string[] args) throws exception { string xml = "<root><e1><![cdata[need help]]></e1></root>"; test0 t = jaxb.unmarshal(new stringreader(xml), test0.class); system.out.println(t.e1); } }
output
need
Comments
Post a Comment