XSLT 为每个组迭代的集合的计数大小 [英] Count size of set iterated by XSLT for-each-group

查看:23
本文介绍了XSLT 为每个组迭代的集合的计数大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个生成另一个 XSLT 样式表的 XSLT 样式表.

I am writing a XSLT stylesheet that generates another XSLT stylesheet.

在代码的一部分中,我正在迭代/分组元素:

In one part of the code, I am iterating / grouping elements:

<xsl:for-each-group
    select="descendant::FormSectionElements[not(LoadBindBase = '')]" 
    group-by="concat(LoadBindBase,SubmitBindBase)">

     ...

</xsl:for-each-group>

在模板中嵌套在不同级别的另一个区域中,我需要获取上述循环将迭代的项目数.

In another area in the template, which is nested at a different level, I need to obtain the number of items which would have been iterated by the above loop.

是否有一个 XPath 表达式可以计算将由 for-each-group 迭代的集合的大小?在模板的另一个区域,我可以获得与 for-each-group 的 select 属性中相同的元素.

Is there an XPath expression that can count the size of the set that would be iterated by for-each-group? In this other area of the template, I am able to obtain the same elements as in the select attribute of the for-each-group.

推荐答案

一个可以计算集合大小的 XPath 表达式会被 for-each-group 迭代吗?

an XPath expression that can count the size of the set that would be iterated by for-each-group?

count(current-group())

将返回当前组的大小和:

will return the size of the current group and:

last()

将返回组数.

这篇关于XSLT 为每个组迭代的集合的计数大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆