标签:
jar包:dom4j
//使用dom4j解析返回的xml
SAXReader reader = new SAXReader();
Document doc = reader.read(new ByteArrayInputStream(xmlResult.getBytes("UTF-8")));
Element element = doc.getRootElement();
List<Element> childElementList = element.elements();
for(Element tmp:childElementList )
{
if(tmp.attributeValue("sqlFormula") != null)
{
Map<String,String> columnMap = new HashMap<String,String>();
columnMap.put("columnName", tmp.attributeValue("name"));
columnMap.put("name", tmp.attributeValue("sqlFormula"));
columnMapList.add(columnMap);
}else
{
getColumnName(tmp.elements(),columnMapList);
}
}
标签:
原文地址:http://www.cnblogs.com/JoeyWong/p/5955100.html