java - Want to enclose data with CDATA at runtime in XML -


i getting xml file. want enclose data within cdata wherever find & in xml file. how should it? appreciated.

   <?xml version="1.0" encoding="utf-8"?> <note>     <to>tove</to>     <from>jani</from>     <heading>reminder</heading>     <body>don't & forget me weekend!</body> </note> 

is looking for?

element element = doc.getdocumentelement();         cdatasection cdata = doc.createcdatasection("mycdata");         cdata.appenddata("contents");         element.appendchild(cdata); 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -