smart-fun / XmlToJson

Android Library for converting XML to JSON and JSON to XML
Apache License 2.0
558 stars 112 forks source link

Error with json array #26

Open InnCreator opened 3 years ago

InnCreator commented 3 years ago

Hello. I have a trouble with convert json to xml.

if I have json in format:

{
     "Questions": [
           {},
           {},
           {}
       ] 
}

then I would like get xml in format:

<Questions>
        <Question>...</Question>
        <Question>...</Question>
        <Question>...</Question>
</Questions>

but I get xml in format:

<Questions>...</Questions>
<Questions>...</Questions>
<Questions>...</Questions>

I think parser dont correct work with array

javadev commented 2 years ago

Hi @InnCreator,

You may try this json

{
  "Questions": {
    "Question": [
      {
      },
      {
      },
      {
      }
    ]
  },
  "#omit-xml-declaration": "yes"
}