gpt4 book ai didi

xpath - 在 Xpath 表达式中使用 count

转载 作者:行者123 更新时间:2023-12-03 16:12:04 30 4
gpt4 key购买 nike

如果我有这样的 XML:(只是举个例子)

<restaurant>
<tables>
<table id=1 />
<table id=2 />
<table id=3 />
</tables>

而且我必须计算表的数量,正确的 Xpath 表达式是:
restaurant/tables/count(table)

或者
count(restaurant/tables/table)

?

谢谢

最佳答案

查看 this Microsoft XPath count() tutorial .

count(/restaurant/tables/table)

将计算上述路径中的表格元素。

关于xpath - 在 Xpath 表达式中使用 count,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13799263/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com