how to convert arbitrary JSON to XML using BaseX?

前端 未结 2 360

How is arbitrary JSON converted to arbitrary XML using BaseX?

I\'m looking at JsonParser from BaseX

相关标签:
2条回答
  • 2021-01-17 03:51

    I think the problem can be solved by the method upstairs. If you only want results, you can do this through some online websites json to xml

    0 讨论(0)
  • 2021-01-17 04:00

    Use the (excellent) JSON-Java library from json.org then

    JSONObject json = new JSONObject(str);
    String xml = XML.toString(json);
    

    toString can take a second argument to provide the name of the XML root node.

    This library is also able to convert XML to JSON using XML.toJSONObject(java.lang.String string)

    Check the Javadoc for more information

    0 讨论(0)
提交回复
热议问题