Leonidas-from-XIV / node-xml2js

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

Bug - Parsing will add the xmlns value to the name of the object #616

Open fcaride opened 3 years ago

fcaride commented 3 years ago

Hey there,

When im parsing an xml like this:

...some things

I call the function like this:

require("xml2js").parseString; parseString( fr.result, { explicitArray: false, }, callback)

And for some reason the returning object is this:

nsAdenda:CFE_Adenda: { $: {xmlns:nsAdenda: undefined} nsAd:CFE: {$: {…}, nsAd:eFact: {…}, Signature: {…}} nsAdenda:Adenda: { ...some things } }

and it should be like this

CFE_Adenda: { (other tags) CFE: { ...some things} }

Somehow the xmlns is getting appended to the object.

Im using the version 0.4.23

Thanks