Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 XPath 的新手,所以不太了解。我一直在谷歌搜索,找不到任何东西,也许我只是在搜索错误的东西,但我想我会在这里问。
我目前正在尝试divide一个set of numbers,,(100, 200, 300)全部由same value。所以我想要:100/2, 200/2, 300/2。我最初认为它会类似于: //products/price div 2,但这会尝试divide将实际设置为 2 而不是 items
divide
set of numbers
(100, 200, 300)
same value
100/2, 200/2, 300/2
//products/price div 2
我该怎么做呢?谢谢
XPath 3.0 有for表达式:
for
for $n in (100, 200, 300) return $n div 2
返回一个序列
(50, 100, 150)
按照要求。