XML创建可排序、分页的数据显示页面(12) '' 计算总页数和总记录数 Function getNumberOfPages(intTotalRecords) Dim intPages intTotalRecords = Data.XMLDocument.selectNodes("/*/*").length intPages = intTotalRecords / intRecordsPerPage If InStr(intPages, ".") > 0 Then intPages = CInt(Left(intPages, InStr(intPages, "."))) + 1 End If getNumberOfPages = intPages End Function '' “下一页”的处理 Function nextPage(intPage) Dim strDisplay Dim strDateRange If CInt(CStr(intPage) * intRecordsPerPage) < Data.selectNodes("/*/*").length Then intPage = CInt(intPage) + 1 Style.XMLDocument.selectNodes("//@OnClick")(1).Value = "previousPage(" & intPage & ")" Style.XMLDocument.selectNodes("//@OnClick")(2).Value = "nextPage(" & intPage & ")" Style.XMLDocument.selectNodes("//xsl:for-each/@select")(1).Value = "./*[position() <= " & (CStr(intPage) * intRecordsPerPage) & " and position() > " & (CInt(intPage) - 1) * intRecordsPerPage & "]" redisplay (intPage)