/*读取header*/
HashMap xmlMap = new HashMap();
xmlMap.put("plugins","http://www.abc.com");
XPath x = configDOC.createXPath("/plugins:buyenvelop/plugins:header");
x.setNamespaceURIs(xmlMap);
Element headElement = (Element)x.selectSingleNode(configDOC);
if(headElement==null)
{
Exception e = new Exception("没有找到buyenvelop/header结点");
logFunction.error(e);
}
bf.append(headElement.getStringValue());
x = configDOC.createXPath("/plugins:buyenvelop/plugins:header/plugins:sellersingtype");
x.setNamespaceURIs(xmlMap);
Element sellersingtypeNode = (Element)x.selectSingleNode(configDOC);
if(sellersingtypeNode==null)
{
Exception e = new Exception("没有找到buyenvelop/header/sellersingtype结点");
logFunction.error(e);
}
String sellersingtype = sellersingtypeNode.getStringValue();
读取xml
最新推荐文章于 2025-02-25 16:52:49 发布