I am using java(JAXB) and i want to retrieve data from CDATA
<![CDATA[Need Help]]>
Desired output
Need Help
Can any body help me out. I tried several solutions.
Thanks!!
I am using java(JAXB) and i want to retrieve data from CDATA
<![CDATA[Need Help]]>
Desired output
Need Help
Can any body help me out. I 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 Help