匹配 XPath 中的不间断空格值 [英] Matching a non-breaking space value in XPath
本文介绍了匹配 XPath 中的不间断空格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
假设我有这样的 XML 结构:
Let's say I have such XML structure:
<table>
<tr>
<td> </td>
</tr>
</table>
如何在谓词中指定与节点值的比较:
How would I specify a comparison with node value in a predicate:
//tr/td[.="???"]
应该指定什么来代替???
?
推荐答案
在 XPath 2 中你可以使用
In XPath 2 you can use
//tr/td[. = codepoints-to-string((160))]
独立于您使用的工具
这篇关于匹配 XPath 中的不间断空格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文