xlst 解析 html c,怎樣實現利用xslt把xml文件內容顯示到html文件中?急!

#1

' 重新設置每頁的記錄數

Function setRecordsPerPage()

If IsNumeric(RecordsPerPage.Value) Then

intRecordsPerPage = CInt(RecordsPerPage.Value)

window_onload

End If

End Function

' 顯示頁數信息

Function setPageCount()

Dim intTotalRecords

PageCount.innerHTML = getNumberOfPages(intTotalRecords)

RecordCount.innerHTML = intTotalRecords

CurrentPage.innerHTML = 1

End Function

' 計算總頁數和總記錄數

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) 

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)

End If

End Function

' 處理“上一頁”

Function previousPage(intPage)

Dim strDisplay

Dim strDateRange

If intPage > 1 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)

End If

End Function

' “第一頁”的處理

Function FirstPage()

Style.XMLDocument.selectNodes("//@OnClick")(1).Value = "previousPage(1)"

Style.XMLDocument.selectNodes("//@OnClick")(2).Value = "nextPage(1)"

Style.XMLDocument.selectNodes("//xsl:for-each/@select")(1).Value = "./*[position()  0]"

transform()

setPageCount()

End Function

' “最末頁”的處理

Function LastPage()

Dim intTotalPages

Dim intTotalRecords

intTotalPages = getNumberOfPages(intTotalRecords)

nextPage (intTotalPages - 1)

End Function

華軟新元北京總部全體員工

guoyan用戶賬號>

郭燕姓名>

行政部部門>

外事與文案助理職位>

guoyan@dd.com電子郵件>

員工>

總部員工>

Function getName(node)

getName = node.Item(0).nodeName

End Function

]]>

第  頁 總  頁    共有  條記錄每頁記錄數:

Sort('')

 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值