从 XML 到 JS 时,“processors.stripPrefix”允许您删除前缀。有没有添加前缀的选项?
const jsonObj = {
foo: {
bar: {
hello: 'world'
}
}
};
const builder = new xml2js.Builder();
const xml = builder.buildObject(jsonObj);
console.log(xml);
//I need this result
<prefix:foo>
<prefix:bar>
<prefix:hello>world</prefix:hello>
</prefix:bar>
</prefix:foo>
请问有什么解决办法吗??