xsl控制循环输出 |
我的xml文件如下:<?xml version="1.0" encoding="GB2312" ?><?xml:stylesheet type="text/xsl" href="DevMessage.xsl"?><Table> <Row> <Cell><Data Type="String">351982086556</Data></Cell> <Cell><Data Type="String">序号</Data></Cell> <Cell><Data Type="String">42.0.45.220</Data></Cell> <Cell><Data Type="String">2004-01-01</Data></Cell> <Cell><Data Type="String">6091145</Data></Cell> <Cell><Data Type="String">test</Data></Cell> </Row> <Row> <Cell><Data Type="String">351982086154</Data></Cell> <Cell><Data Type="String">序号</Data></Cell> <Cell><Data Type="String">42.0.54.154</Data></Cell> <Cell><Data Type="String">2004-01-01</Data></Cell> <Cell><Data Type="String">2288681</Data></Cell> <Cell><Data Type="String">test</Data></Cell> </Row> <Row> <Cell><Data Type="String">351982086754</Data></Cell> <Cell><Data Type="String">序号</Data></Cell> <Cell><Data Type="String">42.0.44.60</Data></Cell> <Cell><Data Type="String">2004-01-01</Data></Cell> <Cell><Data Type="String">6892618</Data></Cell> <Cell><Data Type="String">test</Data></Cell> </Row> </Table>如果我在xsl里循环的时候,不想要第一个数据应该怎么办呢?或者我只想要前两个Row数据应该怎么写xsl呢?
回答:
<xsl:variable name="begin" select="0"/> <xsl:variable name="end" select="5"/> <xsl:for-each select="//Row[position()>$begin and position()<$end]"> <xsl:apply-templates/> </xsl:for-each>
|
|
|

.: 公告
欢迎大家的到来,如果您能够在这里获得收获,那将是我最大的快乐。
同时也欢迎您把精彩的文章、精湛的技术放在这里,让每一个到这里的人都能享受到这种快乐!
--hyl_fr |
|
« | September 2025 | » | 日 | 一 | 二 | 三 | 四 | 五 | 六 | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | | | | | |
|
.: 我的分类(专题)
|

.: 最新日志
.: 最新回复
|

blog名称: 日志总数:9 评论数量:0 留言数量:0 访问次数:46688 建立时间:2005年1月20日 |
|

.: 留言板
|

.: 链接
|

|