const {parseStringPromise, Builder} = require('xml2js');
parseStringPromise( '<apple>banana<carrot />durian</apple>' ).then( x => {
console.log( (new Builder()).buildObject( x ));
} )
Expected output: <apple>banana<carrot />durian</apple>
Actual output: <apple>bananadurian<carrot /></apple>
xml2js@0.4.23 on v14.16.1
Looking at the interim form of document created, this seems to be a bug with node-xml2js and not the builder: { apple: { _: 'bananadurian', carrot: [ '' ] } }
Expected output:
<apple>banana<carrot />durian</apple>
Actual output:<apple>bananadurian<carrot /></apple>
xml2js@0.4.23
onv14.16.1
Looking at the interim form of document created, this seems to be a bug with node-xml2js and not the builder:
{ apple: { _: 'bananadurian', carrot: [ '' ] } }