Answer the question
In order to leave comments, you need to log in
Function to convert object to xml?
The bottom line is that I collect an object in the form and I need to convert it to xml to send a request.
Tell me how this can be done?
Here is an example object:
let objXML = {
Params: {
UsageStart: '2018-09-04',
VehicleYear: '2019',
Mark: 'AUDI',
Model: 'A6',
Modification: {
Power: '180',
},
Cost: '2500000',
Drivers: [
{
name: 'Name',
Age: 27
},
{
name: 'Name2',
age: 30
}
],
}
}
<ns1:Params>
<ns1:UsageStart>2018-09-04</ns1:UsageStart>
<ns1:VehicleYear>2019</ns1:VehicleYear>
<ns1:Mark>AUDI</ns1:Mark>
<ns1:Model>A6</ns1:Model>
<ns1:Modification>
<ns1:Power>180</ns1:Power>
</ns1:Modification>
<ns1:Drivers>
<ns1:Driver>
<ns1:Age>27</ns1:Age>
<ns1:Name>Name</ns1:Name>
</ns1:Driver>
<ns1:Driver>
<ns1:Age>30</ns1:Age>
<ns1:Name>Name2</ns1:Name>
</ns1:Driver>
</ns1:Drivers>
</ns1:Params>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question