jdom 根据多个属性查询各节点值


用XPath.selectSingleNode(root,xpath)方法来查询具体某个节点。
根据单个属性查询:
Element findelement=(Element)XPath.selectSingleNode(root,"/root/biaodan[@bdname='"+chkname+"']");
根据多个属性查询:
Element findelement=(Element)XPath.selectSingleNode(root,"/root/biaodan[@bdname='"+chkname+"'][@liuname='"+flowname+"']");
根据多个属性查询,(多属性之间或的关系):
Element findelement=(Element)XPath.selectSingleNode(root,"/root/biaodan[@bdname='"+chkname+"'] | /root/biaodan[@liuname='"+flowname+"']");

你可能感兴趣的:(jdom)