xml文件节点读取时,selectNodes总是在根节点下查找的问题

参考:https://yq.aliyun.com/articles/39543

 

SAXReader reader = new SAXReader();
Document document = reader.read(new File(dir+"/word/document.xml"));
Element roott=document.getRootElement();

Element addpicnode = (Element) roott.selectNodes("//w:tr").get(1);
Element addpicnode2 = (Element) addpicnode.selectNodes("descendant::w:tc").get(5);

 

获取document.xml全文第二个 <w:tr>节点中的第六个<w:tc>节点  

posted @ 2017-09-11 13:27  爱吐泡泡的小小鱼  阅读(733)  评论(0编辑  收藏  举报