Hello everyone,
I have created a workflow that will pull down data via a RESTful API in JSON, then my code parses and modifies said data. The problem I have is that these APIs I am working with only accept XML to PUT/POST data, and I am looking for an easy way to convert my JSON file to XML.
I did a search on the forums here and google searched a bit and did not find a solution to my problem yet. My preferred language is shell/bash, and while I did find some Python code that does this, my whole work flow is written in shell and uses jq.
Any ideas on how to convert a JSON file to XML in bash? I am hoping I don't have to build the XML on the fly and can just convert it.
I am working on OS X and Debian Wheezy and Ubuntu 14 if that matters. My computer is a Mac that has several VMs of Linux running.
I have created a workflow that will pull down data via a RESTful API in JSON, then my code parses and modifies said data. The problem I have is that these APIs I am working with only accept XML to PUT/POST data, and I am looking for an easy way to convert my JSON file to XML.
I did a search on the forums here and google searched a bit and did not find a solution to my problem yet. My preferred language is shell/bash, and while I did find some Python code that does this, my whole work flow is written in shell and uses jq.
Any ideas on how to convert a JSON file to XML in bash? I am hoping I don't have to build the XML on the fly and can just convert it.
I am working on OS X and Debian Wheezy and Ubuntu 14 if that matters. My computer is a Mac that has several VMs of Linux running.