I have below xml
<measureDef><formula><aggFunction type="sum"><expression><field>ADMIT</field><factTable>ADMIT</factTable><aggregation>SUM</aggregation></expression></aggFunction></formula></measureDef>
and I have converted into json as
let dimensionJson = { "measureDef":{
"formula": {
"aggFunction": {
"_attributes": {
"type": "sum"
},
"expression": {
"field": "ADMIT",
"factTable": "ADMIT",
"aggregation": "SUM"
}
}
}
}
}
Now,in some case I want to convert this Json to xml.So,I'm trying to convert
const xml2JsonOptionsDefault = { compact: true, spaces: 0 };
console.log('FORMULA ARRAY', convert.js2xml(dimensionJson, xml2JsonOptionsDefault));
It is throwing 'maximum call stack size exceeded'.Could someone tell me why it is happening?
From a similar issue in the repo:
This is untested, but you might need to include a "_text" property for any properies in your JSON that are going to have values in the XML.
Example: