如何否定xpath查询?

时间:2011-09-13 01:14:37

标签: dom xpath xpathquery

我想做一个负面的xpath查询:

$xpath->query(//a[DoesNotContain(@class,'some_class')]);

我知道这个

$xpath->query(//a[contains(@class,'some_class')]);

1 个答案:

答案 0 :(得分:11)

$xpath->query(//a[not(contains(@class, 'some_class'))]);