【问题标题】:How to negate xpath query?如何否定xpath查询?
【发布时间】:2011-11-15 18:49:38
【问题描述】:

我想做一个像这样的否定 xpath 查询:

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

我知道这个

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

【问题讨论】:

标签: dom xpath xpathquery


【解决方案1】:
$xpath->query(//a[not(contains(@class, 'some_class'))]);

【讨论】:

  • //a[not[contains(@class,'some_class')]]
猜你喜欢
  • 1970-01-01
  • 2014-03-10
  • 2010-11-14
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多