java如何解析xml格式的字符串
2个回答
展开全部
用jdom
StringReader read = new StringReader(xml);
InputSource source = new InputSource(read);
SAXBuilder sb = new SAXBuilder();
Document doc = sb.build(source);
Element root = doc.getRootElement();
List<Element> nodes = root.getChildren();
StringReader read = new StringReader(xml);
InputSource source = new InputSource(read);
SAXBuilder sb = new SAXBuilder();
Document doc = sb.build(source);
Element root = doc.getRootElement();
List<Element> nodes = root.getChildren();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |