Forum Discussion

darshthakkar's avatar
darshthakkar
Valued Contributor
4 months ago
Solved

Can we generate XML file in pretty print format using native snapLogic snaps?

Hi Team,   I was curious to know if anybody has worked on a use case where they are generating an XML file in pretty print format? We do have "pretty-print" option in JSON formatter however the sa...
  • Thom's avatar
    3 years ago

    Expanding on the solution provided and using information from the web related to javascript, I came up with the following statement. There was experimentation involved for sure.
    $.mapValues((value,key)=> typeof(value) == ‘object’ && value.hasOwnProperty(“@xsi:nil”)? null :value).mapKeys((value,key)=> key.replace(‘ns2:’,‘’))
    mapValues and mapKeys are admittedly a bit of a black box for me still.
    Thanks @JensDeveloper for leading me done a good path.