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

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -