\n is getting appended at end of each line in xml response when using js2xml parser

56 views Asked by At

I have a requirement where I have to generate an xml as response. For this I am doing

responsebody = js2xmlparser.parse("XYZ",responsebody); in my code where I am actually preparing XML. responsebody till this line is actually appending some values from database. Did not want to post it here. I checked the response before this line which looks like below.

{ Del: [ { serial: LineNo: null, SerialNo: '256691560502253916' }] }

After js2xmlparse("XYZ",responsebody) it becomes like below :

 "<?xml version='1.0'?>\n
<XYZ>\n    
    <Del>\n        
        <serial>\n            
            <LineNo>null</LineNo>\n
            <SerialNo>256691560502253916</SerialNo>\n
        </serial>\n
    </Del>\n
</XYZ>"

Any suggestions on how to not get those \n in response. The response that I posted here is from Postman.

1

There are 1 answers

0
PLASMA chicken On

This is an Issue with PostMan and not your Code. Most likely to do with: github:postmanlabs/postman-app-support#5543