json xml converter having array in json string

前端 未结 4 1669
余生分开走
余生分开走 2021-01-25 15:07

I need to convert a json to xml and later on converting that json back to xml, but i am loosing the json array object while this conversion - I am using org.json lib.

4条回答
  •  清酒与你
    2021-01-25 15:50

    There is no way that from the XML string

    
         
               400
         
     
    

    , the library can "guess" that code is an array

    To do these kind of things, you will need to go via a Java model and use a Library such as Jackson to regenerate the JSON

    There are several alternatives to map from XML to Java: XStream is one of them

提交回复
热议问题