XSLT分页

时间:2010-03-23 15:30:30

标签: xslt pagination

我创建了一个格式化xml文档的xslt文档,但我希望将xslt表的结果分页。

这是原始的xlst文档

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">
  <xsl:for-each select="musicInformation/musicdetails">
 <label for="artistname{position()}" id="artistnameLabel{position()}">Artist Name:</label> 
 <span  id ="artistname{position()}"><xsl:value-of select="artistname" /></span> 
 <br/> 
 <label for="recordname{position()}" id="recordnameLabel{position()}">Record Name:</label> 
 <span  id ="recordname{position()}"><xsl:value-of select="recordname" /></span> 
 <br/> 
 <label for="recordtype{position()}" id="recordtypeLabel{position()}">Record Type:</label> 
 <span  id ="recordtype{position()}"><xsl:value-of select="recordtype" /></span> 
 <br/> 
 <label for="format{position()}" id="formatLabel{position()}">Format:</label> 
 <span  id ="format{position()}"><xsl:value-of select="format" /></span> 
 <br/> 
 <a href="xmlDetail.php?mid={@m_id}" >See Details</a>
  <br/><br/> 
  </xsl:for-each>   
  </xsl:template>
</xsl:stylesheet>

1 个答案:

答案 0 :(得分:2)

在XSL中有很多方法可以实现分页。显示了一个基本示例here