need help with xml request post body

ปิด โพสต์แล้ว 5 ปีที่ผ่านมา ชำระเงินเมื่อจัดส่ง
ปิด ชำระเงินเมื่อจัดส่ง

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

หมายเลขโปรเจค: #18607820

เกี่ยวกับโปรเจกต์

6 ข้อเสนอ โปรเจกต์ระยะไกล ใช้งาน %project.latestActivity_relativeTime|แทนที่%

freelancer 6 คน กำลังเสนอราคาในงานนี้ โดยมีราคาเฉลี่ยอยู่ที่ ₹1025

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 ใน 1 วัน
(131 รีวิว)
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 เพิ่มเติม

₹600 INR ใน 1 วัน
(32 รีวิว)
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 ( เพิ่มเติม

₹2250 INR ใน 1 วัน
(14 รีวิว)
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 ใน 0 วัน
(9 รีวิว)
2.5