首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

jdom xpath查寻节点

2012-12-20 
jdom xpath查找节点List namesListnulltry {namesList XPath.selectNodes(doc.getRootElement(), //u

jdom xpath查找节点

List namesList=null;                try {                    namesList = XPath.selectNodes(doc.getRootElement(), "//username");                } catch (JDOMException ex) {                    Logger.getLogger(FormListLogic.class.getName()).log(Level.SEVERE, null, ex);                }

或者:
 List namesList=null;                try {                    namesList = XPath.selectNodes(doc.getRootElement(), "/root/cell/username");                } catch (JDOMException ex) {                    Logger.getLogger(FormListLogic.class.getName()).log(Level.SEVERE, null, ex);                }

热点排行