Мне нужно создать относительно простой XML-документ с некоторой иерархией и некоторыми атрибутами из объекта JS. Сейчас я встаю перед выбором одного из этих модулей:
- https://github.com/davidcalhoun/jstoxml
- https://github.com/soldair/node-jsontoxml
- https://github.com/QuickenLoans/node-easyxml
- https://github.com/michaelkourlas/node-js2xmlparser
Какой модуль выбрать?
Этот вопрос, вероятно, будет отклонен как не очень хороший вопрос, но я не знаю, как его спросить иначе.
Отказ от ответственности: я задал тот же вопрос, что и проблема в каждом репозитории
Это XML, который я хочу построить:
<?xml version="1.0" encoding="UTF-8"?>
<orders>
<order>
<order_orderid>123123</order_orderid>
<order_customerid>345345</order_customerid>
<order_senhcode>7604</order_senhcode>
<order_mediacode>qwert</order_mediacode>
<order_totalshippingcost>0</order_totalshippingcost>
<order_paymentmethod>GB</order_paymentmethod>
<order_paymentnumber />
<order_htmltext />
<order_comment />
<shippingmethodid>02</shippingmethodid>
<order_creditcardnumber />
<order_creditcardnameholder />
<order_creditcardexpiredate />
<order_creditcardsafetycode />
<order_gifttext />
<inv_customer>
<inv_customer_addresstypeid />
<inv_customer_gendermale>0</inv_customer_gendermale>
<inv_customer_firstname>qwerty</inv_customer_firstname>
<inv_customer_initials>Q.W.E</inv_customer_initials>
<inv_customer_prename />
<inv_customer_lastname>Qwerty</inv_customer_lastname>
<inv_customer_company>Some company</inv_customer_company>
<inv_customer_street>Postbus</inv_customer_street>
<inv_customer_housenumber>13</inv_customer_housenumber>
<inv_customer_housenumberadditional />
<inv_customer_postalcode>1234 AB</inv_customer_postalcode>
<inv_customer_city>THERE</inv_customer_city>
<inv_customer_isocodecountry>NL</inv_customer_isocodecountry>
<inv_customer_email>[email protected]</inv_customer_email>
<inv_customer_telephone>0168-123456</inv_customer_telephone>
<inv_customer_mobilenr>06-12345678</inv_customer_mobilenr>
</inv_customer>
<orderlines>
<orderline>
<orderline_orderrecordid>1234</orderline_orderrecordid>
<orderline_orderid>8765432</orderline_orderid>
<orderline_articlenr>164-05-366</orderline_articlenr>
<orderline_quantity>2</orderline_quantity>
<orderline_productdescription>Some gift voucher</orderline_productdescription>
<orderline_price>1233</orderline_price>
</orderline>
<orderline>
<orderline_orderrecordid>5678</orderline_orderrecordid>
<orderline_orderid>8765432</orderline_orderid>
<orderline_articlenr>164-05-367</orderline_articlenr>
<orderline_quantity>3</orderline_quantity>
<orderline_productdescription>Some other gift voucher</orderline_productdescription>
<orderline_price>1244</orderline_price>
</orderline>
</orderlines>
</order>
</orders>