锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
鐩稿叧鍐呭錛?br />銆銆閫氳繃鏁版嵁緇戝畾錛屽彲浠ユ妸涓涓猉ML鏂囨。閾炬帴鍒頒竴涓狧TML欏碉紝鐒跺悗緇戝畾鏍囧噯鐨凥TML鍏冪礌錛屼緥濡係PAN銆乀ABLE錛屽埌鐙珛鐨刋ML鍏冪礌銆侶TML鍏冪礌浼氳嚜鍔ㄦ樉紺烘墍緇戝畾鐨刋ML鍏冪礌鐨勫唴瀹廣?br />銆銆浣跨敤鏁版嵁緇戝畾鐨勪袱涓富瑕佹楠わ細
銆銆1錛夐摼鎺ML鏂囨。鍒版兂瑕佹樉紺篨ML鏁版嵁鐨凥TML欏點?br />銆銆銆銆銆鏈変袱縐嶆柟娉曪細
銆銆銆銆銆銆銆錛圓錛夐氳繃鍦℉TML欏典腑鍖呮嫭鍚嶄負XML鐨凥TML鍏冪礌鏉ュ畬鎴愩備緥濡傦細<XML ID="dsoBook" SRC="Book.xml"></XML>錛孒TML欏典腑鐨勬煇涓厓绱狅紙dsoBook錛夋妸XML鏂囨。涓瑽ook.xml閾炬帴鍒拌欏點?br />銆銆銆銆銆銆銆錛圔錛変嬌鐢ㄦ暟鎹矝鐨勬柟娉曘備緥濡傦細
銆銆銆銆銆銆銆銆銆銆銆<HTML><HEAD>
銆銆銆銆銆銆銆銆銆銆銆銆<TITLE></TITLE>
銆銆銆銆銆銆銆銆銆銆銆</HEAD>
銆銆銆銆銆銆銆銆銆銆銆<BODY><XML ID="dsoInventory">...</XML>
銆銆銆銆銆銆銆銆銆銆銆</BODY></HTML>
銆銆2錛夌粦瀹欻TML鍏冪礌鍒癤ML鍏冪礌銆傚綋緇戝畾涓涓狧TML鍏冪礌鍒頒竴涓猉ML鍏冪礌鏃訛紝HTML鍏冪礌浼氳嚜鍔ㄦ樉紺烘墍緇戝畾鐨刋ML鍏冪礌鐨勫唴瀹廣備緥濡傦細<SPAN DATASRC="#dsoBook" DATAFLD="AUTHOR"></SPAN>錛岀粨鏋滐紝HTML鍏冪礌SPAN鏄劇ず鍏冪礌AUTHOR鐨勫唴瀹廣?br />銆銆涓嬮潰鏄竴涓猉ML鏁版嵁緇戝畾鐨勪緥瀛愶細
聽銆銆<!-- File Name: Inventory Table.htm -->
聽<HTML>
聽<HEAD>
聽聽聽 <TITLE>Book Inventory</TITLE>
聽</HEAD>
聽<BODY>
聽聽聽 <XML ID="dsoInventory" SRC="Inventory.xml"></XML>
聽聽聽 <H2>Book Inventory</H2>
聽聽聽 <TABLE DATASRC="#dsoInventory" BORDER="1" CELLPADDING="5">
聽聽聽聽聽聽 <THEAD>
聽聽 <TH>Title</TH>
聽聽 <TH>Author</TH>
聽聽 <TH>Binding</TH>
聽聽 <TH>Pages</TH>
聽聽 <TH>Price</TH>
聽聽聽聽聽聽 </THEAD>聽聽聽聽
聽聽聽聽聽聽 <TR ALIGN="center">
聽聽 <TD><SPAN DATAFLD="TITLE"
聽聽聽聽聽 STYLE="font-style:italic"></SPAN></TD>
聽聽 <TD><SPAN DATAFLD="AUTHOR"></SPAN></TD>
聽聽 <TD><SPAN DATAFLD="BINDING"></SPAN></TD>
聽聽 <TD><SPAN DATAFLD="ID"></SPAN></TD>
聽聽 <TD><SPAN DATAFLD="PRICE"></SPAN></TD>
聽聽聽聽聽聽 </TR>
聽聽聽 </TABLE>
聽</BODY>
/////////////////////////////////////////////////////
聽<?xml version="1.0"?>
聽<!-- File Name: Inventory.xml -->
聽<INVENTORY>
聽聽聽 <BOOK>
聽聽聽聽聽聽 <TITLE>The Adventures of Huckleberry Finn</TITLE>
聽聽聽聽聽聽 <AUTHOR>Mark Twain</AUTHOR>
聽聽聽聽聽聽 <BINDING>mass market paperback</BINDING>
聽聽聽聽聽聽 <ID>298</ID>
聽聽聽聽聽聽 <PRICE>$5.49</PRICE>
聽聽聽 </BOOK>
聽聽聽 <BOOK>
聽聽聽聽聽聽 <TITLE>Leaves of Grass</TITLE>
聽聽聽聽聽聽 <AUTHOR>Walt Whitman</AUTHOR>
聽聽聽聽聽聽 <BINDING>hardcover</BINDING>
聽聽聽聽聽聽 <ID>462</ID>
聽聽聽聽聽聽 <PRICE>$7.75</PRICE>
聽聽聽 </BOOK>
聽</INVENTORY>
////////////////////////////////////////////////////////////
鍒╃敤XML鏁版嵁緇戝畾瀹炵幇欏甸潰鏃犲埛鏂扮殑鏁版嵁嫻忚鍏蜂綋鍋氭硶錛?br />1)鍦╔ML.jsp涓緩绔嬫暟鎹矝銆?lt;XML id="dsoInventory" src="xmlsrc.jsp" ></XML>錛屽叾涓瓁mlsrc.jsp鏂囦歡鏄氳繃璁塊棶鏁版嵁搴撳悗榪斿洖XML鏍煎紡鐨勬暟鎹紝瀹炵幇鏃跺簲璇ュ寘鍚眰鎬昏褰曟暟鎹佹瘡欏墊樉紺烘潯鏁般佹婚〉鏁般佸垎欏佃繑鍥炴暟鎹瓑鏂規(guī)硶銆?br />銆榪斿洖鐨勬暟鎹牸寮忓錛?br />聽<?xml version="1.0" encoding="GBK" ?>
聽<INVENTORY>
聽<onePageRows>5</onePageRows>
聽<totalRows>21</totalRows>
聽<totalPages>5</totalPages>
聽<intCurrentPage>1</intCurrentPage>
聽 <BOOK>
聽<TITLE>The Adventures of Huckleberry Finn</TITLE>
聽<AUTHOR>Mark Twain</AUTHOR>
聽<BINDING>mass market paperback</BINDING>
聽<ID>298</ID>
聽<PRICE>$5.49</PRICE>
聽</BOOK>
聽<BOOK>
聽<TITLE>Leaves of Grass</TITLE>
聽<AUTHOR>Walt Whitman</AUTHOR>
聽<BINDING>hardcover</BINDING>
聽<ID>462</ID>
聽<PRICE>$7.75</PRICE>
聽</BOOK>
聽</INVENTORY>
浣跨敤鏃跺彲浠ユ牴鎹叿浣撴儏鍐佃繑鍥炵浉搴旂殑XML鏁版嵁銆?br />2錛夊湪欏靛唴緇戝畾HTML鍏冪礌鍒癤ML鍏冪礌,鍊熷姪TABLE鏄劇ず銆?br /><table id="cmmTbl" datasrc="dsoInventory" datafld="BOOk" width="760" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#aaaaaa"聽聽 style="border-collapse: collapse" bordercolor="#333333" >
聽聽聽聽聽聽聽聽聽 <thead>
聽聽聽聽聽聽聽聽聽 <tr bgcolor="#FFCC66">
聽聽聽聽聽聽聽聽聽聽聽 <td聽 HEIGHT="24" BGCOLOR="#f0f9ff" WIDTH="60" >
聽聽聽聽聽聽聽聽聽聽聽聽聽 <div align="center"><b>鏌ョ湅</b></div>
聽聽聽 </td>
聽聽聽聽聽聽聽聽聽聽聽 <td聽 HEIGHT="24" BGCOLOR="#f0f9ff" WIDTH="60" >
聽聽聽聽聽聽聽聽聽聽聽聽聽 <div align="center"><b>浣滆?lt;/b></div>
聽聽聽 </td>
聽聽聽 <td width="580" BGCOLOR="#f0f9ff">
聽聽聽聽聽 <div align="center"><b>鏍囬</b></div>
聽聽聽 </td>
聽聽聽 <td聽 width="60" BGCOLOR="#f0f9ff">
聽聽聽聽聽 <div align="center"><b>浠鋒牸</b></div>
聽聽聽 </td>
聽 </tr></thead>
聽 <tbody>
聽 <tr STYLE="background-color:expression(rowIndex%2==1?'#FFFFFF':'#f7f8f9')">
聽聽聽 <td valign="top" WIDTH="60" align="center"><a聽 datafld="ID" target="_blank"><IMG SRC="images/xq.gif" ALT="鏌ョ湅" border="0"></a></td>
聽聽聽聽聽聽 <td valign="top" WIDTH="60"><span datafld="AUTHOR">浣滆?lt;/span></td>
聽聽聽聽聽聽 <td valign="top" width="580" ><a聽 datafld="ID" target="_blank"><span datafld="TITLE">鏍囬</span></a></td>
聽聽聽聽聽聽 <td valign="top" width="60" > <span datafld="PRICE">浠鋒牸</span></td>
聽 </tr></tbody>
</table>
3錛夊鍔犲垎欏墊寜閽拰鍒嗛〉鎺у埗鐨凧AVASCRIPT璇彞銆?br /><form onsubmit="jump(this);return false;" method="post">
聽聽聽聽聽聽聽聽聽 <div align="right">
聽聽聽聽聽聽聽 姣忛〉鏄劇ず
<input name=pageSize datasrc=#dsoInventory datafld=onePageRows size=2>鏉★紝
聽聽聽聽聽聽聽 鍏?lt;span datasrc=#dsoInventory datafld=totalPages></span>欏?br />聽聽聽聽聽聽聽 <span datasrc=#dsoInventory datafld=totalRows ></span>鏉?br />聽聽聽聽聽聽聽 <input type=submit style="width=0" >
聽聽聽聽聽聽聽 <input name=firstPage type=submit value=棣栭〉 onclick="pageNum.value=1">
聽聽聽聽聽聽聽 <input name=previousPage type=submit value=涓婇〉 onclick="pageNum.value=pageNum.value-1">
聽聽聽聽聽聽聽 絎?lt;input name=pageNum datasrc=#dsoInventory datafld=intCurrentPage size=2>欏?br />聽聽聽聽聽聽聽 <input name=nextPage type=submit value=涓嬮〉 onclick="pageNum.value=(pageNum.value-0)+1">
聽聽聽聽聽聽聽 <input name=lastPage type=submit value=灝鵑〉 onclick="pageNum.value=pageCount.value" >
聽聽聽聽聽聽聽 <input name=pageCount type=hidden datasrc=#dsoInventory datafld=totalPages onpropertychange="pageCount_onpropertychange(form)">
聽聽聽聽聽 </div> </form>
聽<script>
聽聽 if(document.body == null) document.write(" ");
</script>
<script language="javascript">
聽 function jump(form)
聽 {
聽articles.src="xmlsrc.jsp?onePageRows="+form.pageSize.value+"&page="+form.pageNum.value+"&time="+(new Date()).getTime();
聽/////alert("xmlsrc.jsp?page="+form.pageNum.value+"&onePageRows="+form.pageSize.value+"&time="+(new Date()).getTime());
聽///file://鎻愪氦鍚庤繑鍥炴柊鐨刋ML鏁版嵁銆?br />聽 }
聽 function pageCount_onpropertychange(form)
聽 {
聽聽聽 if(form.pageNum.value==1)
聽聽聽 {
聽聽聽聽聽 form.firstPage.disabled=true;
聽聽聽聽聽 form.previousPage.disabled=true;
聽聽聽 }
聽聽聽 else
聽聽聽 {
聽聽聽聽聽 form.firstPage.disabled=false;
聽聽聽聽聽 form.previousPage.disabled=false;
聽聽聽 }
聽聽聽 if(form.pageNum.value==form.pageCount.value)
聽聽聽 {
聽聽聽聽聽 form.nextPage.disabled=true;
聽聽聽聽聽 form.lastPage.disabled=true;
聽聽聽 }
聽聽聽 else
聽聽聽 {
聽聽聽聽聽 form.nextPage.disabled=false;
聽聽聽聽聽 form.lastPage.disabled=false;
聽聽聽 }
聽 }
</script>
//////////////////////////////////////////////////////////////////
<!-- File Name: xml.jsp -->
<script>
聽聽 if(document.body == null) document.write(" ");
</script>
<script language="javascript">
聽 function jump(form)
聽 {
聽dsoInventory.src="xmlsrc.jsp?onePageRows="+form.pageSize.value+"&page="+form.pageNum.value+"&time="+(new Date()).getTime();
聽//alert("xmlsrc.jsp?page="+form.pageNum.value+"&onePageRows="+form.pageSize.value+"&time="+(new Date()).getTime());
聽//鎻愪氦鍚庤繑鍥炴柊鐨刋ML鏁版嵁銆?br />聽 }
聽 function pageCount_onpropertychange(form)
聽 {
聽聽聽 if(form.pageNum.value==1)
聽聽聽 {
聽聽聽聽聽 form.firstPage.disabled=true;
聽聽聽聽聽 form.previousPage.disabled=true;
聽聽聽 }
聽聽聽 else
聽聽聽 {
聽聽聽聽聽 form.firstPage.disabled=false;
聽聽聽聽聽 form.previousPage.disabled=false;
聽聽聽 }
聽聽聽 if(form.pageNum.value==form.pageCount.value)
聽聽聽 {
聽聽聽聽聽 form.nextPage.disabled=true;
聽聽聽聽聽 form.lastPage.disabled=true;
聽聽聽 }
聽聽聽 else
聽聽聽 {
聽聽聽聽聽 form.nextPage.disabled=false;
聽聽聽聽聽 form.lastPage.disabled=false;
聽聽聽 }
聽 }
</script>
<html>
<head>
<title>XML鏃犲埛鏂版彁浜?lt;/title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
聽<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body bgcolor="303880" text="#000000" leftmargin="0" topmargin="0">
<XML id="dsoInventory" src="xmlsrc.jsp?page=1" ></XML>
<input type="button" value="aa" onclick="alert(dsoInventory.xml)">
<table id="cmmTbl" datasrc="dsoInventory" datafld="BOOk" width="760" border="0" cellspacing="1" cellpadding="2" align="center" bgcolor="#aaaaaa"聽聽 style="border-collapse: collapse" bordercolor="#333333" >
聽聽聽聽聽聽聽聽聽 <thead>
聽聽聽聽聽聽聽聽聽 <tr bgcolor="#FFCC66">
聽聽聽聽聽聽聽聽聽聽聽 <td聽 HEIGHT="24" BGCOLOR="#f0f9ff" WIDTH="60" >
聽聽聽聽聽聽聽聽聽聽聽聽聽 <div align="center"><b>鏌ョ湅</b></div>
聽聽聽 </td>
聽聽聽聽聽聽聽聽聽聽聽 <td聽 HEIGHT="24" BGCOLOR="#f0f9ff" WIDTH="60" >
聽聽聽聽聽聽聽聽聽聽聽聽聽 <div align="center"><b>浣滆?lt;/b></div>
聽聽聽 </td>
聽聽聽 <td width="580" BGCOLOR="#f0f9ff">
聽聽聽聽聽 <div align="center"><b>鏍囬</b></div>
聽聽聽 </td>
聽聽聽 <td聽 width="60" BGCOLOR="#f0f9ff">
聽聽聽聽聽 <div align="center"><b>浠鋒牸</b></div>
聽聽聽 </td>
聽 </tr></thead>
聽 <tbody>
聽 <tr STYLE="background-color:expression(rowIndex%2==1?'#FFFFFF':'#f7f8f9')">
聽聽聽 <td valign="top" WIDTH="60" align="center"><a聽 datafld="ID" target="_blank"><IMG SRC="images/xq.gif" ALT="鏌ョ湅" border="0"></a></td>
聽聽聽聽聽聽 <td valign="top" WIDTH="60"><span datafld="AUTHOR">浣滆?lt;/span></td>
聽聽聽聽聽聽 <td valign="top" width="580" ><a聽 datafld="ID" target="_blank"><span datafld="TITLE">鏍囬</span></a></td>
聽聽聽聽聽聽 <td valign="top" width="60" > <span datafld="PRICE">浠鋒牸</span></td>
聽 </tr></tbody>
</table>
<form onsubmit="jump(this);return false;" method="post">
聽聽聽聽聽聽聽聽聽 <div align="right">
聽聽聽聽聽聽聽 姣忛〉鏄劇ず
<input name=pageSize datasrc=#dsoInventory datafld=onePageRows size=2>鏉★紝
聽聽聽聽聽聽聽 鍏?lt;span datasrc=#dsoInventory datafld=totalPages></span>欏?br />聽聽聽聽聽聽聽 <span datasrc=#dsoInventory datafld=totalRows ></span>鏉?br />聽聽聽聽聽聽聽 <input type=submit style="width=0" >
聽聽聽聽聽聽聽 <input name=firstPage type=submit value=棣栭〉 onclick="pageNum.value=1">
聽聽聽聽聽聽聽 <input name=previousPage type=submit value=涓婇〉 onclick="pageNum.value=pageNum.value-1">
聽聽聽聽聽聽聽 絎?lt;input name=pageNum datasrc=#dsoInventory datafld=intCurrentPage size=2>欏?br />聽聽聽聽聽聽聽 <input name=nextPage type=submit value=涓嬮〉 onclick="pageNum.value=(pageNum.value-0)+1">
聽聽聽聽聽聽聽 <input name=lastPage type=submit value=灝鵑〉 onclick="pageNum.value=pageCount.value" >
聽聽聽聽聽聽聽 <input name=pageCount type=hidden datasrc=#dsoInventory datafld=totalPages onpropertychange="pageCount_onpropertychange(form)">
聽聽聽聽聽 </div> </form>
</body>
</html>
銆瀹屾垚浠ヤ笂涓夋鍚庯紝褰撶敤鎴瘋繘琛岀炕欏墊搷浣滄椂灝嗚嚜鍔ㄥ琛ㄦ牸鍐呯殑鏁版嵁榪涜閲嶆柊鐨刋ML緇戝畾錛岃屼笉鍒鋒柊欏甸潰銆?br />