創建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')]";