JsonToXmlPreparser
|
Configuration file |
None. |
|
Class name |
com.ebd.hub.datawizard.parser.JsonToXmlPreparser |
Description
This preparser is deprecated.
This preparser is able to convert a JSON document into an XML file, which can be parsed by the XML parser.
Important note: The root node to parse the XML file should always be "JsonData". This ensures that multiple records are created if the JSON object is a list.
Example
The file "demo.json" is converted into "demo.xml".
demo.json
{ "termsofpayment1":"", "vat2":"7", "ilnsupp":"123456789", "free_text":"", "orderno":"4711", "vat1":"19", "ilnreceiver":"", "deliverynoteno":"0815", "invoicno":"08154711", "termsofpayment2":"", "currency":"EUR", "ilnbuyer":"400000045687", "complexposition_position":[ { "amount":200, "unit":"PCE", "vat_pos":"19", "itemno_supp":"87490", "content":"Sausages", "positionno":"1", "price":30, "EAN":"3654878784" }, { "amount":1, "unit":"PCE", "vat_pos":"", "itemno_supp":"8786767", "content":"", "positionno":"2", "price":56, "EAN":"546546" } ]}demo.xml
<?xml version="1.0" encoding="UTF-8"?><JsonData> <deliverynoteno>0815</deliverynoteno> <termsofpayment1/> <termsofpayment2/> <vat2>7</vat2> <ilnsupp>123456789</ilnsupp> <free_text/> <ilnreceiver/> <invoicno>08154711</invoicno> <currency>EUR</currency> <orderno>4711</orderno> <vat1>19</vat1> <ilnbuyer>400000045687</ilnbuyer> <complexposition_position> <itemno_supp>87490</itemno_supp> <vat_pos>19</vat_pos> <positionno>1</positionno> <price>30</price> <EAN>3654878784</EAN> <content>Sausages</content> <amount>200</amount> <unit>PCE</unit> </complexposition_position> <complexposition_position> <itemno_supp>8786767</itemno_supp> <vat_pos/> <positionno>2</positionno> <price>56</price> <EAN>546546</EAN> <content/> <amount>1</amount> <unit>PCE</unit> </complexposition_position></JsonData>