我真的对 xml 解析感到震惊。我有一个这样的 xmlstring
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://a.com /">{"Id":87,"Name":"jo@a.com","FirstName":"Jo","LastName":"var","Profile":"","Designation":""}</string>
我想将json作为字符串..我不知道该怎么做..
我在下面给出的尝试..我真的很震惊请帮助我
DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
InputSource is = new InputSource();
is.setCharacterStream(new StringReader(fromServer));
Document doc = db.parse(is);
NodeList nodes = doc.getElementsByTagName("data");