need help with xml request post body

Closed Posted 5 years ago Paid on delivery
Closed Paid on delivery

I need someone to quickly tell me how to convert pretty xml like :

<?xml version = "1.0" encoding = "utf-8"?>

<!-- [login to view URL] -->

<?xml-stylesheet type = "text/xsl" href = "[login to view URL]" ?>

<plane>

<year> 1977 </year>

<make> Cessna </make>

<model> Skyhawk </model>

<color> Light blue and white </color>

</plane>

to this in nodejs :

'<?xml version = "1.0" encoding = "utf-8"?>\n<!-- [login to view URL] -->\n<?xml-stylesheet type = "text/xsl" href = "[login to view URL]" ?>\n<plane>\n <year> 1977 </year>\n <make> Cessna </make>\n <model> Skyhawk </model>\n <color> Light blue and white </color>\n</plane>'

So that I can use it to send POST request to an API.

important : it must be in nodejs

Express JS JavaScript Node.js XML

Project ID: #18607820

About the project

6 proposals Remote project Active 5 years ago

6 freelancers are bidding on average ₹1025 for this job

vano101

Нello Looks like it's pretty simple, there is just needed to insert \n just after end of each line. But I have follow question? How will you test? How can you make sure result is correct? Thanks.

₹600 INR in 1 day
(131 Reviews)
5.8
mateenirshad

Hello, This could be achieved in a lot of ways depending on the source e.g. 1. use a regular expression to remove white space and replace \r\n and \n with \n. 2. require a library to parse xml. Call it's parser wi More

₹600 INR in 1 day
(32 Reviews)
5.1
deepthi2889

Hi,  I am a Full stack developer in Microsoft technologies.  My area of expertise is web application development (asp.Net web forms, MVC, classic ASP), web services (SOAP & RESTFul), MySql & Sql Server as back end ( More

₹2250 INR in 1 day
(14 Reviews)
5.0
AntonBliznetc

Hello, i can do it in 1-2 hours. please send source code. i return result. i can use team-viewer, if need. Pay only after complete

₹1250 INR in 0 days
(9 Reviews)
2.5