Occational warning that xml2Json is deptrecated

xml2Json has a lot of formatting options.

For example, try the following…

let respBodyXML = pm.response.text();

let parseString = require('xml2js').parseString;

parseString(respBodyXML, {
    ignoreAttrs: true, 
    explicitArray: false,
}, function (err, result) {
    console.log(result);
});

It depends on how complex your XML is, but have a look here (scroll to the bottom) for all of the formatting options.

xml2js - npm (npmjs.com)

Have a look here for another topic that shows some of the formatting options in action.

How to retrieve the names of xml tags - :person_raising_hand: Help - Postman Community

1 Like