Hi.
I was converted from xml to JsonObject. and then converted from JsonObject to xml.
It shown "<o> " instead of "<mi>" tag of xml.
I hope to display original of xml and converted of xml.
How method are same original of xml and converted of xml?
Thank you.
===================
original xml
<?xml version="1.0" encoding="UTF-8"?>
<MI>
<name type="string">json</name>
<bool type="boolean">true</bool>
<int type="number">1</int>
</MI>
========================
converted from XML to jsonObject string
{"name":"json","bool":true,"int":1}
=====================
converted from JsonObject to XML
<?xml version="1.0" encoding="UTF-8"?>
<o><bool type="boolean">true</bool><int type="number">1</int><name type="string">json</name></o>
=== source ===
String sourceFile = System.getProperty("user.dir") + File.separator + "src" + File.separator + "test" + File.separator + "java" + File.separator + "com" +
File.separator + "mocomsys" + File.separator + "parser" + File.separator + "xml" + File.separator + "test.xml";
JsonObjectFactory jof = new JsonObjectFactory();
InputStream is = getInputStream(sourceFile);
JSONObject jsonObject = (JSONObject) new XMLSerializer().readFromStream(is);
System.out.println(jsonObject.toString());
System.out.println("=====================");
String xml = new XMLSerializer().write(jsonObject);
System.out.println(xml);