Open brunovu20 opened 4 years ago
Yes please! I have to generate xml for a foreign application and they will throw an error if certain fields aren't wrapped in CDATA. So either remove the condition or have the cdata flag as a tristate option like true | false | 'force' where force overrides the condition, that way you stay backwards compatible.
I fixed that on this repository: https://github.com/brunovuftv2018/node-xml2js
Yes please! I have to generate xml for a foreign application and they will throw an error if certain fields aren't wrapped in CDATA. So either remove the condition or have the cdata flag as a tristate option like true | false | 'force' where force overrides the condition, that way you stay backwards compatible.
yes, I met the same problem. Please remove this condition or perhaps add anothor option named forceCdata?
Hi guys,
I have a problem on the builder with CDATA. Here is just a simple example on ReadMe:
`var xml2js = require('xml2js');
var obj = {root: {$: {id: "my id"}, _: "my inner text"}};
var builder = new xml2js.Builder({ cdata: true }); var xml = builder.buildObject(obj);`
Xml generated:
`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>