Leonidas-from-XIV / node-xml2js

XML to JavaScript object converter.
MIT License
4.84k stars 598 forks source link

undefined when try to access to object property #609

Closed ondine93 closed 3 years ago

ondine93 commented 3 years ago

Hi, probably a stupid question, but when i try to access to a property of this object, for example Trasm or RevDateTime i see undefined on the console. This is the output of the parsed result console.dir(res); { 'n1:DatiCorrispettivi': { '$': { 'xmlns:n1': 'http://local.doc/docs/xsd/corrispettivi/dati/v1.0', versione: 'COR10', 'xmlns:ds': 'http://www.w3.org/2000/09/xmldsig#', 'xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance' }, Trasm: [ [Object] ], RevDateTime: [ '2021-04-01T20:49:37+02:00' ], DatiRT: [ [Object] ] } } when i try this console.dir(res["RevDateTime"]); i see undefined usually i access object property with the dor or square brackets property accessor but nothing work here. What am I doing wrong?

ondine93 commented 3 years ago

just a stupid parenthesis, sorry