fix escape bug

This commit is contained in:
Looly
2021-06-24 07:53:21 +08:00
parent a97e967ecd
commit 949c7a856e
14 changed files with 166 additions and 36 deletions

View File

@@ -14,4 +14,15 @@ public class XMLTest {
Assert.assertEquals("<aaa>你好</aaa><键2>test</键2>", s);
}
@Test
public void escapeTest(){
String xml = "<a>•</a>";
JSONObject jsonObject = XML.toJSONObject(xml);
Assert.assertEquals("{\"a\":\"\"}", jsonObject.toString());
String xml2 = XML.toXml(JSONUtil.parseObj(jsonObject));
Assert.assertEquals(xml, xml2);
}
}