Curl XML/Json format file


#1

Hi,

I have the code to process the json format file and it’s able to process json format file. I have another source of data and its xml format. Both xml and json file fomats will have same fields. below is the example.

json:

[
  {
    "A" : [
      {
        "B" : {
          "x" : "sdfsd",
          "y" : "gsdg"
        },
        "z" : "dfg"
      }
    ]
  }
]

xml:

    <A>
       <B>
         <x>sdf</x>
         <y>wer3</y>
      </B>
         <z>gfdg</z>
    </A>

So the code is able to process json format but not xml. Getting below error.
Invalid field name B for type test.

Appreciate any help.

Thanks

@rileysiebel @ColumbusL