public void paseXmlStream(String parseXml)
{
SAXBuilder builder = new SAXBuilder(false);
StringReader in = new StringReader(parseXml);
Document doc = null;
try
{
doc = builder.build(in);
}
catch (JDOMException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
Element root = doc.getRootElement();
int size = root.getAttributes().size();
System.out.println(size);
}
SAX解析XML
最新推荐文章于 2020-12-18 11:36:30 发布