Search⌘ K

Converting JSON to XML and Vice Versa

Let’s learn how to convert records between the JSON and XML formats.

We'll cover the following...

We are going to produce a utility that converts records between the JSON and XML formats. The input is given as a command-line argument. The utility tries to guess the format of the input starting from XML. If xml.Unmarshal() fails, then the utility tries using ...