node-xml2js
node-xml2js copied to clipboard
valueProcessors question
Question about valueProcessors
option:
Given this setup:
const xml2jsParser = new xml2js.Parser({
explicitArray: false, // Always put child nodes in an array if true; otherwise an array is created only if there is more than one.
explicitRoot: true,
mergeAttrs: true, // Merge attributes and child elements as properties of the parent, instead of keying attributes off a child attribute object.
valueProcessors: [
function (value, name) {
console.log(`name ${name}, value ${value}`);
return value
}
]
});
Is it true that I would expect to see output for every XML tag and value that I parsing using: xml2jsParser.parseString(xml, (err, json) => { result = json });
I ask because I am NOT seeing that behavior.
This is in 0.4.23
.