No internet connection
  1. Home
  2. General

JSON to XML Conversion

By Mark Carpenter @mark.carpenter
    2022-03-06 16:02:54.403Z

    Any chance you can add a JSON to XML Converter (to match the JSON to XML you've already implemented)? We are going to be retrieving orders across an EDI sftp interface; they are XML formatted files. So reading the orders and converting to JSON we need to post to our order system is straight forward, but the acks / invoices and inventory status updates need to be posted back as XML files.

    • 2 replies
    1. I
      isedwinr @isedwinr
        2022-03-08 17:35:11.551Z

        Hello Mark,

        (I guess you meant *"to match the XML to JSON " * )

        I also asked for this at first, but worked around it in my case.

        • Load xyz.XML
        • Convert XML to JSON
        • Extract from JSON via Path
        • Extract JSON Array element values to CSV
        • Do some magic cleanup with Find and Replace ;)
        • Replace an element at the document level with these array values
        • Write back to xyz.XML

        Don't know if it helps you in any way, or maybe offers an alternative


        1. MMark Carpenter @mark.carpenter
            2022-03-08 17:46:37.609Z

            Hi Edwin, thanks for your response. Yes, an interesting path to consider and you are correct I meant "to match the XML to JSON". The two formats are quite similar so should be straight forward. I'll bet a library automation could be written that passes the JSON and returns the XML.