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
Post a Comment