V. Create ASP files to display XML data (index.asp)
The function of this file is to read and display the XML data, first create an XML image and then read the XML into memory, and use DOM to isolate the
The data you want.
<%
strSourceFile = Server.MapPath ("/") & "List.xml"
' Get the path to the XML file, which is different depending on your virtual directory.
Set objxml = Server.CreateObject ("Microsoft.FreeThreadedXMLDOM")
' Create an XML pair as a free thread
Objxml.load (strsourcefile) ' reads the XML file into memory
Set objrootsite = ObjXML.documentElement.selectSingleNode ("NewList")
' Select the NewList node
%>
<title> Message Book </title>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<style type= "Text/css"
!--
TD {Font-family: "Song body"; font-size:9pt; Text-decoration:none}
A {font-family: "Song body"; Font-size:9pt color: #0066CC; Text-decoration:none}
a:hover {color: #FF6600; Text-decoration:underline}
-->
</style>
<table width= "80%" border= "0" cellspacing= "1" cellpadding= "4" align= "center" bgcolor= "#CCCCCC"
<TR bgcolor= "#000000" >
<TD colspan= "2" ><font color= "#FFFFFF" "Yi Pu <a Href=" postnew.asp "><font color= #FFFFFF > > write a new message
</font> </a> </font> </td>
</tr>
<%
PageSize = 10 ' Suppose each page shows 10 messages
Allnodesnum =objrootsite.childnodes.length-1
' Get the child node data (since the maximum number of child nodes from the number of nodes is 0 minus 1)
Pagenum=allnodesnumpagesize+1 ' Calculate the total number of pages
Pageno=request.querystring ("PageNo")
If pageno= "then" if it is every time you get the page, navigate to each page to display the latest message
Pageno=pagenum
End If
Starnodes=pageno*pagesize-1 ' Get Start node
Endnodes= (PageNo-1) *pagesize ' Get End node
If endnodes<0 Then
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.