开门见山,
我正在使用的数据库:
http://metalab.unc.edu/bosak/xml/eg/shaks200.zip
查询 1:
count(db:open("shaks200","r_and_j.xml")//ACT)
查询 2:
count(db:open("shaks200","r_and_j.xml")//ACT[.])
查询 1 给出的结果是 185,而查询 2 给出的结果是 5。
5 是正确答案,但为什么 Query 1 没有给出正确答案?
最佳答案
感谢您的报告和引用的示例文件。该错误已在 latest stable snapshot 中修复。并且也将在下一个正式版本(本周末到期)中提供。
关于xml - XPath 计数为什么它不能本能地工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11006381/