Pagination of XML data
1. Book. XML uses the same file as the previous one.
<? XML version = "1.0" encoding = "UTF-8"?>
<Books>
<Book id = "0001" bookcategory = "unt" amount = "150" remain = "80"
Discount = "8.5">
<Title> Romance of the Three Kingdoms </title>
<Author> Luo Guanzhong </author>
<Publisher> Literature and Art Publishing House </publisher>
<ISBN> 0-764-58007-8 </ISBN>
<Price> 80.0 </price>
</Book>
<Book id = "0002" bookcategory = "unt" amount = "300" remain = "180"
Discount = "8.7">
<Title> Dream of Red Mansions </title>
<Author> CAO Xueqin </author>
<Publisher> sanqin Publishing House </publisher>
<ISBN> 7805468397 </ISBN>
<Price> 22 </price>
</Book>
<Book id = "0003" bookcategory = "unt" amount = "200" remain = "175"
Discount = "8.5">
<Title> Journey to the West (previous and next) </title>
<Author> Wu chengen </author>
<Publisher> People's Literature Publishing House </publisher>
<ISBN> 7020008739 </ISBN>
<Price> 40.12 </price>
</Book>
<Book id = "0004" bookcategory = "unt" amount = "300" remain = "192"
Discount = "8.7">
<Title> Water Margin (previous and next) </title>
<Author> Wu chengen </author>
<Publisher> times Literature and Art Publishing House </publisher>
<ISBN> 7538714014 </ISBN>
<Price> 40.85 </price>
</Book>
<Book id = "0065" bookcategory = "Literature" amount = "120" remain = "86"
Discount = "8.0">
<Title> history of Foreign Literature (Asian-African volume) </title>
<Author> Zhu Weizhi </author>
<Publisher> Nankai University Press </publisher>
<ISBN> 7-310-01122-8 </ISBN>
<Price> 20 </price>
</Book>
<Book id = "0076" bookcategory = "Literature" amount = "130" remain = "84"
Discount = "8.0">
<Title> A Brief History of European and American Literature in the 20th Century </title>
<Author> Li Ming bin </author>
<Publisher> peking university press </publisher>
<ISBN> 7-301-04616-2 </ISBN>
<Price> 21.8 </price>
</Book>
<Book id = "0098" bookcategory = "Literature" amount = "140" remain = "76"
Discount = "7.0">
<Title> famous Western Literature and Art Theory tutorial (I) </title>
<Author> HU Jing </author>
<Publisher> peking university press </publisher>
<ISBN> 7-301-00649-7 </ISBN>
<Price> 24 </price>
</Book>
<Book id = "0012" bookcategory = "Literature" amount = "210" remain = "60"
Discount = "8.5">
<Title> famous Western Literature and Art Theory tutorial (ii) </title>
<Author> HU Jing </author>
<Publisher> peking university press </publisher>
<ISBN> 7-301-00179-7 </ISBN>
<Price> 23 </price>
</Book>
<Book id = "0036" bookcategory = "Literature" amount = "100" remain = "80"
Discount = "8.3">
<Title> document on critical history of Chinese Literature Theory </title>
<Author> Zhang shaokang </author>
<Publisher> peking university press </publisher>
<ISBN> 7-301-04091-1 </ISBN>
<Price> 25 </price>
</Book>
<Book id = "0018" bookcategory = "computer" amount = "200" remain = "100"
Discount = "8.2">
<Title> Introduction to Computers </title>
<Author> Ding yuechao </author>
<Publisher> Higher Education Press </publisher>
<ISBN> 7-04-014768-8 </ISBN>
<Price> 19.7 </price>
</Book>
<Book id = "0218" bookcategory = "computer" amount = "400" remain = "300"
Discount = "8.5">
<Title> Program Design Basics </title>
<Author> edited by Zhang jiemin </author>
<Publisher> Higher Education Press </publisher>
<ISBN> 7-04-012652-4 </ISBN>
<Price> 17.6 </price>
</Book>
<Book id = "0318" bookcategory = "computer" amount = "100" remain = "60"
Discount = "8.0">
<Title> data structure and algorithm </title>
<Author> edited by Wang Xiaodong </author>
<Publisher> Higher Education Press </publisher>
<ISBN> 7-04-013204-4 </ISBN>
<Price> 21.8 </price>
</Book>
<Book id = "0181" bookcategory = "computer" amount = "250" remain = "156"
Discount = "8.0">
<Title> XML Web Service Development </title>
<Author> Microsoft </author>
<Publisher> Higher Education Press </publisher>
<ISBN> 7-04-015825-6 </ISBN>
<Price> 65.00 </price>
</Book>
<Book id = "0189" bookcategory = "computer" amount = "230" remain = "160"
Discount = "8.0">
<Title> VB. NET Programming Language </title>
<Author> Microsoft </author>
<Publisher> Higher Education Press </publisher>
<ISBN> 7-04-013188-9 </ISBN>
<Price> 86.00 </price>
</Book>
<Book id = "0028" bookcategory = "computer" amount = "100" remain = "90"
Discount = "7.5">
<Title> quick JavaScript tutorial </title>
<Author> by Michael moncur </author>
<Publisher> mechanical industry press </publisher>
<ISBN> 7-111-09070-5 </ISBN>
<Price> 28.00 </price>
</Book>
<Book id = "0074" bookcategory = "computer" amount = "130" remain = "78"
Discount = "7.8">
<Title> JAVA Implementation of Software Engineering </title>
<Author> slephen R. schach </author>
<Publisher> mechanical industry press </publisher>
<ISBN> 7-111-06714-2 </ISBN>
<Price> 51.00 </price>
</Book>
<Book id = "0109" bookcategory = "computer" amount = "210" remain = "160"
Discount = "8.0">
<Title> artificial intelligence </title>
<Author> Nils J. Nilsson </author>
<Publisher> mechanical industry press </publisher>
<ISBN> 7-111-04738-6 </ISBN>
<Price> 45.00 </price>
</Book>
<Book id = "0305" bookcategory = "computer" amount = "115" remain = "26"
Discount = "7.5">
<Title> Asp development instance </title>
<Author> qinghan computer studio </author>
<Publisher> mechanical industry press </publisher>
<ISBN> 7-980039-74-2 </ISBN>
<Price> 53.00 </price>
</Book>
</Books>
2.display the HTML file of the split page, pagingbook.html
<! Doctype HTML public "-// W3C // dtd html 4.0 transitional // en">
<Object classid = "CLSID: 550dda30-0541-11d2-9ca9-0060b0ec3d39" id = "xmldso"> </Object>
<HTML>
<Head>
<Title> display the book information by page </title>
</Head>
<Script language = "JavaScript">
Function loadxml ()
{
VaR xmldoc = xmldso. xmldocument;
Xmldoc. Load ("book. xml ");
}
</SCRIPT>
<Body onload = "loadxml ()">
<P align = "center"> <B> <font size = "4"> display the book information table by page </font> </B> </P>
<HR>
<Table id = "book" datasrc = "# xmldso" border = "1" cellpadding = "7" 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 quantity </Th>
</Thead>
<Tr>
<TD> <span dataworks = "title"> </span> </TD>
<TD> <span dataworks = "bookcategory"> </span> </TD>
<TD> <span dataworks = "ISBN"> </span> </TD>
<TD> <span dataworks = "author"> </span> </TD>
<TD> <span dataworks = "publisher"> </span> </TD>
<TD> <span dataworks = "price"> </span> RMB </TD>
<TD> <span dataworks = "remain"> </span> </TD>
</Tr>
</Table>
<Center>
<Input type = "button" onclick = "book. previouspage ()" value = "Previous Page">
<Input type = "button" onclick = "book. nextpage ()" value = "next page">
<Input type = "text" value = "3" size = "5" onblur = "book. datapagesize = This. value;"> pen
</Center>
</Body>
</Html>
3. Test the running effect.