例如,以下 xpath 字符串是否有效:
/web:input_text[@value=null]
这意味着该元素没有值属性。
最佳答案
此 XPath 返回没有 value
属性的 web:input_text
:
/web:input_text[not(@value)]
XPath /web:input_text[@value=null]
选择 web:input_text
其值为 value
属性 = null
节点。
关于xml - Xpath标准是否支持属性中的空值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7567231/