XSL仅在for-each中显示10个循环

Den*_*one 6 xslt

我的XML有100个AgentSales节点我到目前为止只想显示前10个节点

<xsl:for-each select="NewDataSet/AgentSales">
    <tr>
        <xsl:if test="(position() mod 2 = 1)">
            <xsl:attribute name="bgcolor">#cccccc</xsl:attribute>
        </xsl:if>
        <td>
            <span style="font:20px arial; font-weight:bold;">
                <xsl:value-of select="AgentName"/>
            </span>
        </td>
        <td>
            <span style="font:20px arial; font-weight:bold;">
                <xsl:value-of select="State"/>
            </span>
        </td>
        <td>
            <span style="font:20px arial; font-weight:bold;">
                <xsl:value-of select="time"/>
            </span>
        </td>
    </tr>
</xsl:for-each>
Run Code Online (Sandbox Code Playgroud)

网站的新功能,但当我使用代码括号时,并非我的所有代码都显示?至少不在下面的预览中.

Dim*_*hev 7

用途:

<xsl:for-each select="NewDataSet/AgentSales[not(position() >10)]">
  <!-- Process each node from the node-list -->
</xsl:for-each>
Run Code Online (Sandbox Code Playgroud)

更好的是:

<xsl:apply-templates select="NewDataSet/AgentSales[not(position() >10)]"/>
Run Code Online (Sandbox Code Playgroud)