node-xml
node-xml copied to clipboard
Multiple mixed content being ignored
The following is modified example from the readme:
var example5 = [{
toys: [{
_attr: {
decade: '80s',
locale: 'US'
}
},
{
toy: [{
_attr: {
decade: '80s',
locale: 'US'
}
},
'Transformers',
{
toya: [{
_attr: {
knowing: 'half the battle'
}
}, 'GI Joe']
}
]
}
]
}];
And it produces
<toys decade="80s" locale="US">
<toy decade="80s" locale="US">
Transformers
<toya knowing="half the battle">GI Joe</toya>
</toy>
</toys>
However, if another piece of mixed data is added like this:
var example5 = [{
toys: [{
_attr: {
decade: '80s',
locale: 'US'
}
},
{
toy: [{
_attr: {
decade: '80s',
locale: 'US'
}
},
'Transformers',
{
toya: [{
_attr: {
knowing: 'half the battle'
}
}, 'GI Joe']
},
' and the A-team'
]
}
]
}];
The sub object is just ignored and the following is outputted:
<toys decade="80s" locale="US">
<toy decade="80s" locale="US">Transformers and the A-team</toy>
</toys>
+1
any update?
I should have a PR soon