/**
* 读取XML文件里其中一个结点的值
*
* @param xmlName xml名
* @param xmlRoot xml节点
* @return xml节点值的集合
* @throws FileNotFoundException
* @throws IOException
* @throws JDOMException
*/
private List<?> readXmlFile(String xmlName, String xmlRoot)
throws FileNotFoundException, IOException, JDOMException {
File file = new File(xmlName);
Document document = new SAXBuilder().build(file);
Element allElement = document.getRootElement();
XPath dsWebBasePathXpath = XPath.newInstance(xmlRoot);
List<?> elementList = (List<?>) dsWebBasePathXpath
.selectNodes(allElement);
List<String> list = new ArrayList<String>();
for (int i = 0; i < elementList.size(); i++) {
Element element = (Element) elementList.get(i);
list.add(element.getValue());
}
return list;
}