node.js萌新,在使用xml2js解析xml文件时没有得到真实的数据
我的一个猜测,是不是我的数据在'soap:Body': [ [Object] 这个元素里面,如果是的话,我要如何才能获取???谢谢
我使用官网的示例代码可以正确的将xml解析为json,但真实的数据无法解析
我使用的代码如下
xml = '......'
parseString(xml, function(err, result) {
... console.log(result);
... })
结果如下:
{ 'soap:Envelope':
{ '$':
{ 'xmlns:soap': 'http://schemas.xmlsoap.org/soap/envelope/',
'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
'xmlns:xsd': 'http://www.w3.org/2001/XMLSchema' },
'soap:Body': [ [Object] ] } }
{ comment: '',
sgmlDecl: '',
textNode: '',
tagName: '',
doctype: '',
procInstName: '',
procInstBody: '',
entity: '',
attribName: '',
attribValue: '',
cdata: '',
script: '',
c: '',
q: '',
bufferCheckPosition: 65536,
opt:
{ trim: false,
normalize: false,
xmlns: false,
lowercase: undefined },