<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<XML id = "xmldso" src = "book. xml"> </XML>
<HTML>
<Head>
<Title> display the book information by page. </title>
</Head>
<Script language = "JavaScript">
VaR pageno = 1;
VaR objbook = xmldso. recordset;
Function selectrecord (element)
{
// Obtain the record column number
Recordno = element. parentelement. rowindex;
// Create an XML recordset
Objbook = xmldso. recordset;
// Specify the current location
Objbook. absoluteposition = recordno + (pageno-1) * tblbooks. datapagesize;
// Obtain the element value
Title. innerhtml = objbook ("title"). value;
Bookcategory. innerhtml = objbook ("bookcategory"). value;
ISBN. innerhtml = objbook ("ISBN"). value;
Author. innerhtml = objbook ("author"). value;
Publisher. innerhtml = objbook ("publisher"). value;
Price. innerhtml = objbook ("price"). value;
Remain. innerhtml = objbook ("remain"). value;
}
Function pre_page ()
{
If (pageno> 1)
{
Tblbooks. previouspage ();
Pageno = pageno-1;
}
}
Function next_page ()
{
If (pageno <objbook. recordcount/tblbooks. datapagesize)
{
Tblbooks. nextpage ();
Pageno = pageno + 1;
}
}
</SCRIPT>
<Body>
<Center> <B> display the book information by page </B> </center>
<Table id = "tblbooks" datasrc = "# xmldso" border = "1" align = "center" datapagesize = "3">
<Thead>
<TH> title </Th>
<TH> Category </Th>
<TH> book number </Th>
<TH> author </Th>
<TH> press </Th>
<TH> pricing </Th>
<TH> remaining amount </Th>
</Thead>
<Tr>
<TD onclick = selectrecord (this)> <span dataworks = "title"> </span> </TD>
<TD onclick = selectrecord (this)> <span dataworks = "bookcategory"> </span> </TD>
<TD onclick = selectrecord (this)> <span dataworks = "ISBN"> </span> </TD>
<TD onclick = selectrecord (this)> <span dataworkflow = "author"> </span> </TD>
<TD onclick = selectrecord (this)> <span dataworks = "publisher"> </span> </TD>
<TD onclick = selectrecord (this)> <span dataworks = "price"> </span> </TD>
<TD onclick = selectrecord (this)> <span dataworks = "remain"> </span> </TD>
</Tr>
</Table>
<Center>
<Input type = "button" onclick = "pre_page ()" value = "Previous Page">
<Input type = "button" onclick = "next_page ()" value = "next page">
<Input type = "text" value = "3" size = "5" onblur = "tblbooks. datapagesize = This. value;"> pen
</Center>
<Center> click the row of books you are interested in </center>
<HR/>
<Center> single book information: Title: <span id = "title"> </span> </center>
<Table border = "1" align = "center">
<Tr>
& Lt; TD width = "50%" & gt;
Category: <span id = "bookcategory"> </span> <br>
Book No.: <span id = "ISBN"> </span> <br>
Author: <span id = "author"> </span> <br>
</TD>
& Lt; TD width = "50%" & gt;
Published: <span id = "publisher"> </span> <br>
Pricing: <span id = "price"> </span> <br>
Remaining: <span id = "remain"> </span> <br>
</TD>
</Tr>
</Table>
</Body>
</Html>
The execution result is as follows: