现在的位置: 首页 > 综合 > 正文

XPATH错误方法未知:contains(@” 的解决办法

2014年04月16日 ⁄ 综合 ⁄ 共 507字 ⁄ 字号 评论关闭

创建xmlDom后加上“xmlDom.setProperty('SelectionLanguage','XPath');
xPath查询如:等值查询:String xPath = "users/user[username='huo' and password='123']";模糊查询:String xPath = "users/user[contains(username,'huo') and contains(password,'123')]";
 ---------------------------------------------------------------------------------------------------------- 
XML第二种存储方式 .xml

xPath查询如:加"@" 用以查询属性值等值查询:String xPath = "users/user[@username='huo' and @password='123']";模糊查询:String xPath = "users/user[contains(@username,'huo') and contains(@password,'123')]";

抱歉!评论已关闭.