这是我正在努力工作的xsl文件的片段。
我想根据Body中的循环计数更改标题中元素request-tot-queries
的值。非常感谢您的帮助!
<HEADER>
<request-tot-queries>$Counter</request-tot-queries>
</HEADER>
<Body>
<xsl:for-each select="//Request/Responses/Pooled/ResidenceHistory/Residencies/Residency">
<count><xsl:variable name="counter" select="position()"/></count>
<xsl:if test="DateRange/To/Date[@Type!='Present']">
<subject-query>
.
.
.
</subject-query>
</xsl:if>
</xsl:for-each>
</Body>
答案 0 :(得分:1)
使用count()
功能:
<HEADER>
<request-tot-queries>
<xsl:value-of select="count(//Request/Responses/Pooled/ResidenceHistory/Residencies/Residency)"/>
</request-tot-queries>
</HEADER>