欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

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

发布时间:2025/4/16 编程问答 61 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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('')

 

总结

以上是生活随笔为你收集整理的xlst 解析 html c,怎樣實現利用xslt把xml文件內容顯示到html文件中?急!的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。