javascript - How to build CDATA values in xml2js for node server? -


i'm trying parse xml file , change cdata value of nodes using xml2js. , write new xml document file. i've tried everything, still not getting anywhere. tried using string "" , "cdata" option in builder class. doesn't work. writes text node undefined i.e. [![cdata[undefined]]

fs.readfile(xmlfileurl, function(err, data) {     parser.parsestring(data, function(err, result) {         //change node value .... , build         var xml = builder.buildobject(result);         fs.writefile(xmlfileurl), xml, function(err) {             if (err) {                 console.log(err);                 return;             }         });     }); }); 


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -