I am currently trying to parse an XML through meteor with xml2js and insert it into Mongodb. I do this in server/fixtures.js with the following code:
Iati.insert({
test: xml2js.parseString(Assets.getText('iati.xml'))
})
Xml2js does seem to convert something but the output seems nonsensical namely an object with teh following attributes:
test: Object
ENTITIES: Object
attribList: Array[0]
attribName: ""
attribValue: ""
bufferCheckPosition: 65536
c: ""
cdata: ""
closed: false
closedRoot: false
column: 0
comment: ""
doctype: ""
entity: ""
error: null
line: 0
looseCase: "toUpperCase"
noscript: true
opt: Object
position: 0
procInstBody: ""
procInstName: ""
q: ""
sawRoot: false
script: ""
sgmlDecl: ""
startTagPosition: 9347
state: 0
strict: true
tag: null
tagName: ""
tags: Array[0]
textNode: ""
trackPosition: true
__proto__: Object
__proto__: Object
How should I change my code to get the actual XML as output? Thank you in advance