gpt4 book ai didi

variables - 使用 Xpath for..in..return 时在 XSLT/XPath 中创建增量计数变量?

转载 作者:行者123 更新时间:2023-12-03 15:33:03 28 4
gpt4 key购买 nike

我正在使用 XPath for 循环等效 -

<xsl:for-each select="for $i in 1 to $length return $i">...

我真的需要一个计数变量,我将如何实现这一目标?

谢谢,

灰。

最佳答案

首先要注意的是

for $i in 1 to $length return $i

只是一种冗长的写作方式
1 to $length

在 for-each 中,您可以将当前整数值作为“.”访问。或作为 position() .

关于variables - 使用 Xpath for..in..return 时在 XSLT/XPath 中创建增量计数变量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18098163/

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