5
我願做一個負XPath查詢這樣的:如何否定xpath查詢?
$xpath->query(//a[DoesNotContain(@class,'some_class')]);
我知道這個
$xpath->query(//a[contains(@class,'some_class')]);
我願做一個負XPath查詢這樣的:如何否定xpath查詢?
$xpath->query(//a[DoesNotContain(@class,'some_class')]);
我知道這個
$xpath->query(//a[contains(@class,'some_class')]);
$xpath->query(//a[not(contains(@class, 'some_class'))]);
// a [not [contains(@ class,'some_class')]]] – sam
的可能重複(HTTP [如何使用XPath的 「不」?] ://stackoverflow.com/questions/1550981/how-to-use-not-in-xpath) – kenorb