我想實現使用XPath以下,但我不能選擇工作.....Xpath的多個過濾器中選擇
我有以下情形:
性別男性或女性 名優產品:品牌A或品牌B或BrandC或BrandD
我想選擇所有的男性只有品牌A,品牌B屬性和BrandC
如果我用下面的;
/node[gender[1] = "male"] (perfect selects only the male products)
/node[gender[1] = "male" and brand[1][contains(.,"BrandA")]](perfect Xpath selects only the male products with the BrandA)
到目前爲止好,但如果我用站立下方是不會選擇任何....
/node[gender[1] = "male" and brand[1][contains(.,"BrandA")] and brand[1][contains(.,"BrandB")]]
有什麼建議?我究竟做錯了什麼?
謝謝!
你可以顯示你的示例XML摘錄? – Rao