我有以下xml
<measureDef><formula><aggFunction type="sum"><expression><field>ADMIT</field><factTable>ADMIT</factTable><aggregation>SUM</aggregation></expression></aggFunction></formula></measureDef>
我已经转换成 json 为
let dimensionJson = { "measureDef":{
"formula": {
"aggFunction": {
"_attributes": {
"type": "sum"
},
"expression": {
"field": "ADMIT",
"factTable": "ADMIT",
"aggregation": "SUM"
}
}
}
}
}
现在,在某些情况下,我想将此 Json 转换为 xml。所以,我正在尝试转换
const xml2JsonOptionsDefault = { compact: true, spaces: 0 };
console.log('FORMULA ARRAY', convert.js2xml(dimensionJson, xml2JsonOptionsDefault));
它正在抛出“超出最大调用堆栈大小”。有人能告诉我为什么会这样吗?