【发布时间】:2020-04-11 07:56:35
【问题描述】:
我正在尝试计算标签“报告”中冒号后跟空格的数量:
<report>But that doesn't work either: what do you guys think: To be solved</report>
我的 xpath 代码
`report[count([text()=": "]) > 1]`
但它不起作用
【问题讨论】:
-
count(tokenize(/report/text(), ": "))-1
-
我的实际 XML 文件标签是
<authors><author><gnm>Lee<gnm><snm>Auch<snm></author><report>Search Results: Count the number of words in a xml node using xsl: Thank you<report></authors>我将您的代码调整为/report[count(tokenize(/text(), ': '))-1 gt 1]因为我必须在报告标签中找到多个冒号空间使用情况.. 但它不起作用
标签: xpath count punctuation