【发布时间】:2020-01-28 11:48:03
【问题描述】:
我需要使用带有 group-ending-with 属性的 for-each-group 将一个长表分成较小的表。在每个表中,我需要拥有该组的索引,但我无法找出可用的变量 - 如果有的话。
示例 xml:
<table>
<row type='A'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='A'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='A'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='A'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
</table>
期望的输出:
<table>
<title>Table 1</title>
<row type='A'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
</table>
<table>
<title>Table 2</title>
<row type='A'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
</table>
<table>
<title>Table 3</title>
<row type='A'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
</table>
<table>
<title>Table 4</title>
<row type='A'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
<row type='B'><cell>Some value</cell>
</table>
我已经完成了分组,但我找不到将索引放入表标题的方法。也许它是微不足道的,但搜索词组和索引没有给出任何有用的结果。
【问题讨论】: