获取xml中的根节点的值

  获取xml中根节点的方法

 public String getNode() throws Exception,IOException {

   SAXBuilder builder=new SAXBuilder();

  Document doc=builder.build(this.getClass().getClassLoader().getResourceAsStream(路径));

return doc.getRootElement().getValue();

 

 

}

你可能感兴趣的:(xml)