不同标签的一个 XPath 表达式

One XPath expression for different tags

是否可以在 XPath 表达式中加入带有 'and' 的标签?

例如,我需要所有活动元素。可以通过两种适合我的方式选择它们:

  1. .//input[not(@disabled)]
  2. .//select[not(@disabled)]

但是我需要为此编写一个 XPath 表达式。
类似于 .//input[not(@disabled)] and .//select[not(@disabled)]

.//input[not(@disabled)]|.//select[not(@disabled)]

| 设置操作; returns两组节点的并集

Boolean, Comparison, and Set Expressions