日期:2014-05-20 浏览次数:20917 次
String xml = ""; StringReader read = new StringReader(xml); InputSource source = new InputSource(read); SAXBuilder sb = new SAXBuilder(); Document doc = sb.build(source); Element root = doc.getRootElement(); System.out.println(root.getName());// 输出根元素的名称(测试)