狠狠爱成人网_日韩一级在线_国产综合自拍_亚洲精品韩国_亚洲视频导航_麻豆成人在线播放_欧美jjzz_一区在线视频观看_美脚丝袜一区二区三区在线观看_欧美91视频

當(dāng)前位置:系統(tǒng)之家 > 技術(shù)開(kāi)發(fā)教程 > 詳細(xì)頁(yè)面

用XML與ASP完成購(gòu)物車

用XML與ASP完成購(gòu)物車

更新時(shí)間:2019-10-06 文章作者:未知 信息來(lái)源:網(wǎng)絡(luò) 閱讀次數(shù):

    在線購(gòu)物已經(jīng)變得很平常了,而在使用購(gòu)物車的時(shí)候,用戶期望在其身上能夠獲得(足夠的)靈活性。看看你能夠如何把ASP和XML結(jié)合起來(lái)提供所用戶需要的功能。

    創(chuàng)建虛擬購(gòu)物車的方法從來(lái)都不是單一的。最近,我碰到一個(gè)機(jī)會(huì)重新編寫了一個(gè)經(jīng)典的ASP購(gòu)物車,讓它成為一個(gè)擁有與原來(lái)類似的外觀和感覺(jué),但是更加靈活和更加快速的購(gòu)物車。我決定利用XML,并開(kāi)發(fā)一個(gè)跨瀏覽器的解決方案。現(xiàn)在讓我來(lái)告訴你我自己碰到的一些問(wèn)題,以及我是如何改進(jìn)原有設(shè)計(jì)的。

    原來(lái)的購(gòu)物車
    由于原來(lái)的購(gòu)物車是針對(duì)特定的一組客戶的,所以它更多地依賴于對(duì)用戶的培訓(xùn)而非易用性。除了完全清空購(gòu)物車,沒(méi)有其他的機(jī)制用來(lái)對(duì)(所購(gòu)的)內(nèi)容進(jìn)行更改。如果你往購(gòu)物車?yán)锓湃肓隋e(cuò)誤的東西或者錯(cuò)誤的數(shù)量,你不得不從頭開(kāi)始才能夠更正這一錯(cuò)誤。

    而不為人知的是,原來(lái)的購(gòu)物車再也無(wú)法變得更好。有限數(shù)量的行被顯示出來(lái),而客戶會(huì)一頁(yè)一頁(yè)地翻閱購(gòu)物車?yán)锏膬?nèi)容。這種方法的問(wèn)題是,所有的東西都被保存在一個(gè)以ASP會(huì)話ID為基礎(chǔ)的表格里。當(dāng)客戶瀏覽購(gòu)物車內(nèi)容的時(shí)候,就會(huì)進(jìn)行一次查詢。此外,如果會(huì)話超時(shí),購(gòu)物車的內(nèi)容將會(huì)一直保留在表格里,直到有人手動(dòng)刪除它。

    新的方法
    我不想重復(fù)以前的錯(cuò)誤,所以新的購(gòu)物車將會(huì)基于XML會(huì)話而不會(huì)基于表格。這種方法有多個(gè)好處。首先,整個(gè)購(gòu)物車以XML數(shù)據(jù)島(Data Island)的形式保存在客戶端上,如下面列表A所示。在進(jìn)行簡(jiǎn)單瀏覽的時(shí)候,這就不再需要對(duì)表格進(jìn)行查詢了。但是用到了MozillaDSO()和xmlPage()函數(shù)。

列表A

    <root>     
    <row>          
    <selected></selected>          
    <line>1</line>          
    <quantity>1</quantity>          
    <item>W01</item>          
    <description>Swept hilt rapier</description>        
    <weight>3.6</weight>          
    <unitprice>195.95</unitprice>     
    </row> 
    
    <row>          
    <selected></selected>          
    <line>2</line>          
    <quantity>2</quantity>          
    <item>W02</item>          
    <description>Hand-and-a-half sword</description>          
    <weight>5.8</weight>          
    <unitprice>250.95</unitprice>     
    </row>  
   
    <row>          
    <selected></selected>          
    <line>3</line>          
    <quantity>1</quantity>          
    <item>W03</item>          
    <description>Wood long bow</description>          
    <weight>2.7</weight>          
    <unitprice>190.00</unitprice>     
    </row>
     
    <row>          
    <selected></selected>          
    <line>4</line>          
    <quantity>1</quantity>          
    <item>W04</item>          
    <description>Wizard staff</description>          
    <weight>3.1</weight>          
    <unitprice>89.25</unitprice>     
    </row> 
    
    <row>          
    <selected></selected>          
    <line>5</line>          
    <quantity>1</quantity>          
    <item>C01</item>          
    <description>Gauntlets</description>         
    <weight>0.7</weight>          
    <unitprice>25.00</unitprice>     
    </row>    

    <row>          
    <selected></selected>          
    <line>6</line>          
    <quantity>5</quantity>          
    <item>C02</item>          
    <description>Knee-high boots</description>          
    <weight>1.9</weight>          
    <unitprice>95.00</unitprice>     
    </row>    

    <row>          
    <selected></selected>          
    <line>7</line>          
    <quantity>9</quantity>          
    <item>C04</item>          
    <description>Cloak</description>          
    <weight>1.0</weight>          
    <unitprice>125.00</unitprice>     
    </row>    

    <row>          
    <selected></selected>          
    <line>8</line>          
    <quantity>22</quantity>          
    <item>C05</item>          
    <description>Orc repellent</description>          
    <weight>1.0</weight>          
    <unitprice>8.95</unitprice>     
    </row>    

    <row>          
    <selected></selected>          
    <line>9</line>          
    <quantity>1</quantity>          
    <item>W05</item>          
    <description>Dwarf axe</description>          
    <weight>8.0</weight>          
    <unitprice>358.95</unitprice>     
    </row>    

    <row>          
    <selected></selected>          
    <line>10</line>          
    <quantity>1</quantity>          
    <item>A01</item>          
    <description>Steel cap</description>          
    <weight>2.8</weight>          
    <unitprice>219.95</unitprice>     
    </row>   

    <row>          
    <selected></selected>          
    <line>11</line>          
    <quantity>1</quantity>          
    <item>A02</item>          
    <description>Chainmail shirt</description>          
    <weight>15.3</weight>          
    <unitprice>487.22</unitprice>     
    </row>    

    <row>          
    <selected></selected>          
    <line>12</line>          
    <quantity>1</quantity>          
    <item>A03</item>          
    <description>Mithril shirt</description>          
    <weight>0.4</weight>          
    <unitprice>87236.03</unitprice>     
    </row>    

    <row>          
    <selected></selected>          
    <line>13</line>          
    <quantity>1</quantity>          
    <item>W07</item>          
    <description>Elvish long sword</description>          
    <weight>1.9</weight>          
    <unitprice>794.99</unitprice>     
    </row>    

    <row>          
    <selected></selected>          
    <line>14</line>          
    <quantity>1</quantity>         
    <item>W08</item>          
    <description>Elvish short sword</description>          
    <weight>0.8</weight>          
    <unitprice>435.99</unitprice>     
    </row>    

    <row>          
    <selected></selected>          
    <line>15</line>          
    <quantity>3</quantity>          
    <item>W09</item>          
    <description>Short sword</description>          
    <weight>1.5</weight>          
    <unitprice>89.95</unitprice>     
    </row>
    </root>

    列表B

    function update() {
      /* Function:      update
         Creation Date: May 5, 2003
         Programmer:    Edmond Woychowsky
         Purpose:       The purpose of this function is to apply bound Data

     Island  changes to the full Data Island.  This is

     accomplished by matching line numbers in both Data

     Islands.  Once this has been completed the full Data

     Island is sent to the server via XMLHTTP.

     Update Date:       Programmer:              Description:
      */


     var objXMLHTTP;

     //     XMLHTTP request object

     var reWork = new RegExp('internet explorer','gi');


     document.body.style.cursor = 'wait';     //     Set cursor


     for(var i=0;i < objPage.bound.getElementsByTagName('row').length;i++)

     for(var j=0;j < objPage.full.getElementsByTagName('row').length;j++)

     if(objPage.bound.getElementsByTagName('line').item(i).firstChild.nodeValue == objPage.full.getElementsByTagName('line').item(j).firstChild.nodeValue) {

     for(var k=0;k < objPage.bound.getElementsByTagName('row').item(i).childNodes.length;k++)

     if(objPage.bound.getElementsByTagName('row').item(i).childNodes.item(k).nodeName != '#text')

     switch(objPage.bound.getElementsByTagName('row').item(i).childNodes.item(k).nodeName.toLowerCase()) {

     case('quantity'):

     case('selected'):

     try {

     objPage.full.getElementsByTagName('row').item(j).childNodes.item(k).firstChild.nodeValue =     objPage.bound.getElementsByTagName('row').item(i).childNodes.item(k).firstChild.nodeValue;

     }

     catch(e) {

     try {

     objPage.full.getElementsByTagName('row').item(j).childNodes.item(k).appendChild(objPage.bound.getElementsByTagName('row').item(i).childNodes.item(k).firstChild.cloneNode(true));

     }

     catch(e) { }

     }


     break;

     }

     break;

     }

     //     Send updates

     if(reWork.test(navigator.appName))

     objXMLHTTP = new ActiveXObject('Microsoft.XMLHTTP');

     else

     objXMLHTTP = new XMLHttpRequest();

     objXMLHTTP.open('GET','xmlServer.asp',true);

     objXMLHTTP.setRequestHeader('content-type','text/xml');

     objXMLHTTP.onreadystatechange = function() {

     var reWork = new RegExp('internet explorer','gi');

     if(objXMLHTTP.readyState == 4) {

     if(reWork.test(navigator.appName))

     objPage.full.XMLDocument.loadXML(unescape(objXMLHTTP.responseText));

     else

     objPage.full.innerHTML = unescape(objXMLHTTP.responseText);

     //Handle empty page

     if(objPage.page() > objPage.pagecount())

     objPage.showPrevious();

     else

     objPage.showPage();

     // Display page info

     document.getElementById('currentpage').lastChild.nodeValue = objPage.page();

     document.getElementById('totalpages').lastChild.nodeValue = objPage.pagecount();

     document.body.style.cursor = 'auto';

     } }

     // IE work around

     try {

     objPage.full.innerHTML = objPage.full.XMLDocument.xml;

     }

     catch(e) { }

     if(reWork.test(navigator.appName))

     objXMLHTTP.setRequestHeader('request',escape(objPage.full.XMLDocument.xml));

     else

     objXMLHTTP.setRequestHeader('request',escape(objPage.full.innerHTML));

     objXMLHTTP.send(null);

     }

    在做進(jìn)一步講解之前,我會(huì)在同一個(gè)句子里使用Mozilla和XMLHTTP。有書(shū)面的證據(jù)表明Mozilla支持XMLHTTP。盡管其句法與Internet Explorer所用的句法稍有不同,但這并不是JavaScript無(wú)法處理的東西。完整的客戶端解決方案見(jiàn)A,而ASP見(jiàn)下面的列表C

    圖A

 

    列表C

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
</head>

<body>

<table cellPadding="0" width="100%" border="0" id="table1">
 <tr>
  <td class="subhead1">Listing C</td>
 </tr>
 <tr bgColor="#ff0000">
  <td height="1">
  <img height="1" src="http://builder.com.com/i/tr/spacer.gif" width="1"></td>
 </tr>
 <tr>
  <td height="5">
  <img height="5" src="http://builder.com.com/i/tr/spacer.gif" width="1"></td>
 </tr>
 <tr>
  <td>
  <%@ Language=JScript %>

 <%
     Response.Buffer = true;

     var strTitle = 'Honest Ed\'s Adventure Emporium';

     Session('shoppingcart') = '<root>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>1</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>W01</item>';
     Session('shoppingcart') += '<description>Swept hilt rapier</description>';
     Session('shoppingcart') += '<weight>3.6</weight>';
     Session('shoppingcart') += '<unitprice>195.95</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>2</line>';
     Session('shoppingcart') += '<quantity>2</quantity>';
     Session('shoppingcart') += '<item>W02</item>';
    Session('shoppingcart') += '<description>Hand-and-a-half sword</description>';
     Session('shoppingcart') += '<weight>5.8</weight>';
     Session('shoppingcart') += '<unitprice>250.95</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>3</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>W03</item>';
     Session('shoppingcart') += '<description>Wood long bow</description>';
     Session('shoppingcart') += '<weight>2.7</weight>';
     Session('shoppingcart') += '<unitprice>190.00</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>4</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>W04</item>';
     Session('shoppingcart') += '<description>Wizard staff</description>';
     Session('shoppingcart') += '<weight>3.1</weight>';
     Session('shoppingcart') += '<unitprice>89.25</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
    Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>5</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>C01</item>';
     Session('shoppingcart') += '<description>Gauntlets</description>';
     Session('shoppingcart') += '<weight>0.7</weight>';
     Session('shoppingcart') += '<unitprice>25.00</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>6</line>';
     Session('shoppingcart') += '<quantity>5</quantity>';
     Session('shoppingcart') += '<item>C02</item>';
     Session('shoppingcart') += '<description>Knee-high boots</description>';
     Session('shoppingcart') += '<weight>1.9</weight>';
     Session('shoppingcart') += '<unitprice>95.00</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>7</line>';
     Session('shoppingcart') += '<quantity>9</quantity>';
     Session('shoppingcart') += '<item>C04</item>';
     Session('shoppingcart') += '<description>Cloak</description>';
     Session('shoppingcart') += '<weight>1.0</weight>';
     Session('shoppingcart') += '<unitprice>125.00</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
    Session('shoppingcart') += '<line>8</line>';
     Session('shoppingcart') += '<quantity>22</quantity>';
     Session('shoppingcart') += '<item>C05</item>';
     Session('shoppingcart') += '<description>Orc repellent</description>';
     Session('shoppingcart') += '<weight>1.0</weight>';
     Session('shoppingcart') += '<unitprice>8.95</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>9</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>W05</item>';
     Session('shoppingcart') += '<description>Dwarf axe</description>';
     Session('shoppingcart') += '<weight>8.0</weight>';
     Session('shoppingcart') += '<unitprice>358.95</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>10</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>A01</item>';
     Session('shoppingcart') += '<description>Steel cap</description>';
     Session('shoppingcart') += '<weight>2.8</weight>';
     Session('shoppingcart') += '<unitprice>219.95</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>11</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>A02</item>';
     Session('shoppingcart') += '<description>Chainmail shirt</description>';
     Session('shoppingcart') += '<weight>15.3</weight>';
     Session('shoppingcart') += '<unitprice>487.22</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>12</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>A03</item>';
     Session('shoppingcart') += '<description>Mithril shirt</description>';
     Session('shoppingcart') += '<weight>0.4</weight>';
     Session('shoppingcart') += '<unitprice>87236.03</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>13</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>W07</item>';
     Session('shoppingcart') += '<description>Elvish long sword</description>';
     Session('shoppingcart') += '<weight>1.9</weight>';
     Session('shoppingcart') += '<unitprice>794.99</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>14</line>';
     Session('shoppingcart') += '<quantity>1</quantity>';
     Session('shoppingcart') += '<item>W08</item>';
     Session('shoppingcart') += '<description>Elvish short sword</description>';
     Session('shoppingcart') += '<weight>0.8</weight>';
     Session('shoppingcart') += '<unitprice>435.99</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '<row>';
     Session('shoppingcart') += '<selected></selected>';
     Session('shoppingcart') += '<line>15</line>';
     Session('shoppingcart') += '<quantity>3</quantity>';
     Session('shoppingcart') += '<item>W09</item>';
     Session('shoppingcart') += '<description>Short sword</description>';
     Session('shoppingcart') += '<weight>1.5</weight>';
     Session('shoppingcart') += '<unitprice>89.95</unitprice>';
     Session('shoppingcart') += '</row>';
     Session('shoppingcart') += '</root>';


 %>

 <?xml version="1.0" encoding="UTF-8"?>

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
     <title><%=strTitle %></title>
    <style type="text/css">

 TD

 {
    FONT-SIZE: 9pt;
    FONT-FAMILY: Tahoma

 }

 XML

 {
  WIDTH: 0px;
  HEIGHT: 0px;
  DISPLAY: none;

 }
    </style>
    <script language="JavaScript">
      <!-- <![CDATA[

 function setEvents() {
  /* Function:      setEvents
     Creation Date: April 25, 2003
     Programmer:    Edmond Woychowsky
     Purpose:       The purpose of this function is to create an instance
                        of the xmlPage object, initialize the object and
                         perform page initialization.

     Update Date:       Programmer:              Description:
  */

     objPage = new xmlPage();                         //     Create instance

     for(var i=0;i < document.getElementsByTagName('input').length;i++)
          if(document.getElementsByTagName('input').item(i).getAttribute('type') == 'button') {
               document.getElementsByTagName('input').item(i).style.height = '26px';
               document.getElementsByTagName('input').item(i).style.width = '100px';

               document.getElementsByTagName('input').item(i).onmouseover = new Function('this.style.color = \'#FF0000\'');
               document.getElementsByTagName('input').item(i).onmouseout = new Function('this.style.color = \'#000000\'');
          }

                                                            //     Establish relationships
     objPage.bound = document.getElementById('xmlWindow');
     objPage.full = document.getElementById('xmlFull');
     objPage.table = document.getElementById('boundTable');

     objPage.length(10);                                   //     Set page length
     objPage.showPage();                                   //     Show first page

                                                            //     Display page info
     try {
          document.getElementById('currentpage').removeChild(document.getElementById('currentpage').firstChild);
          document.getElementById('totalpages').removeChild(document.getElementById('totalpages').firstChild);
     }
     catch(e) { }

     document.getElementById('currentpage').appendChild(document.createTextNode(objPage.page()));
     document.getElementById('totalpages').appendChild(document.createTextNode(objPage.pagecount()));

 }


 function update() {
  /* Function:      update
     Creation Date: May 5, 2003
     Programmer:    Edmond Woychowsky
     Purpose:       The purpose of this function is to apply bound Data
                        Island  changes to the full Data Island.  This is
                         accomplished by matching line numbers in both Data
                         Islands.  Once this has been completed the full Data
                         Island is sent to the server via XMLHTTP.

     Update Date:       Programmer:              Description:
  */

     var objXMLHTTP;                                   //     XMLHTTP request object
     var reWork = new RegExp('internet explorer','gi');

     document.body.style.cursor = 'wait';     //     Set cursor

     for(var i=0;i < objPage.bound.getElementsByTagName('row').length;i++)
          for(var j=0;j < objPage.full.getElementsByTagName('row').length;j++)
               if(objPage.bound.getElementsByTagName('line').item(i).firstChild.nodeValue == objPage.full.getElementsByTagName('line').item(j).firstChild.nodeValue) {
                    for(var k=0;k < objPage.bound.getElementsByTagName('row').item(i).childNodes.length;k++)
                         if(objPage.bound.getElementsByTagName('row').item(i).childNodes.item(k).nodeName != '#text')
                              switch(objPage.bound.getElementsByTagName('row').item(i).childNodes.item(k).nodeName.toLowerCase()) {
                                   case('quantity'):
                                   case('selected'):
                                        try {
                                             objPage.full.getElementsByTagName('row').item(j).childNodes.item(k).firstChild.nodeValue = objPage.bound.getElementsByTagName('row').item(i).childNodes.item(k).firstChild.nodeValue;
                                        }
                                        catch(e) {
                                             try {
                                                 objPage.full.getElementsByTagName('row').item(j).childNodes.item(k).appendChild(objPage.bound.getElementsByTagName('row').item(i).childNodes.item(k).firstChild.cloneNode(true));
                                             }
                                            catch(e) { }
                                        }

                                        break;
                              }

                    break;
               }

                                                           //     Send updates
     if(reWork.test(navigator.appName))
          objXMLHTTP = new ActiveXObject('Microsoft.XMLHTTP');
     else
          objXMLHTTP = new XMLHttpRequest();

     objXMLHTTP.open('GET','xmlServer.asp',true);
     objXMLHTTP.setRequestHeader('content-type','text/xml');
  
     objXMLHTTP.onreadystatechange = function() {
          var reWork = new RegExp('internet explorer','gi');

          if(objXMLHTTP.readyState == 4) {
               if(reWork.test(navigator.appName))
                    objPage.full.XMLDocument.loadXML(unescape(objXMLHTTP.responseText));
               else
                    objPage.full.innerHTML = unescape(objXMLHTTP.responseText);

                                                            //    Handle empty page
               if(objPage.page() > objPage.pagecount())
                    objPage.showPrevious();
               else
                    objPage.showPage();

                                                            //     Display page info
               document.getElementById('currentpage').lastChild.nodeValue = objPage.page();
               document.getElementById('totalpages').lastChild.nodeValue = objPage.pagecount();

               document.body.style.cursor = 'auto';
         }
     }

                                                            //     IE work around
     try {
          objPage.full.innerHTML = objPage.full.XMLDocument.xml;
     }
     catch(e) { }

     if(reWork.test(navigator.appName))
          objXMLHTTP.setRequestHeader('request',escape(objPage.full.XMLDocument.xml));
       else
          objXMLHTTP.setRequestHeader('request',escape(objPage.full.innerHTML));
  
     objXMLHTTP.send(null);

 }


 function ieBusTable(objTable) {
  /* Function:      ieBusTable
     Creation Date: April 30, 2003
     Programmer:    Edmond Woychowsky
     Purpose:       The purpose of this function is to remove the garbage
                         that Microsoft Internet Explorer displays when a table's
                         cell contains null.  This porblem only applies to div
                         and span tags.

     Update Date:       Programmer:              Description:
  */

     var reWork = new RegExp('internet explorer','gi');

     if(reWork.test(navigator.appName))
          if(objTable.readyState == 'complete') {
               for(var i=0;i < objTable.getElementsByTagName('div').length;i++)
                    if(objTable.getElementsByTagName('div').item(i).innerText.length == 0)
                         objTable.getElementsByTagName('div').item(i).innerText = ' ';

               for(var i=0;i < objTable.getElementsByTagName('span').length;i++)
                    if(objTable.getElementsByTagName('span').item(i).innerText.length == 0)
                         objTable.getElementsByTagName('span').item(i).innerText = ' ';
          }

 }


 function xmlPage() {
  /* Function:      xmlPage
     Creation Date: April 25, 2003
     Programmer:    Edmond Woychowsky
     Purpose:       The purpose of this class is to define the cross-browser
                         (Mozill & IE) paging object.

     Update Date:       Programmer:              Description:
  */

                                                            //     Variables
     var objCommonAncestor = null;                   //     datafld common ancestor
     var objInitialTable = null;
     var strBound = null;                              //     XML window data island
     var strXML = null;                                   //     XML full data island
    var strTable = null;                              //     Bound HTML/XHTML table
     var intAbsolutePosition = 0;                    //     Window item index
     var intPage = 1;                                   //     Logical page number
     var intLength = 15;                                   //     Logical page length
     var blnInitialize = false;                         //     Initialize binds

                                                            //     Properties
     this.bound = null;                                   //     XML window data island
     this.full = null;                                   //     XML full data island
     this.table = null;                                   //     Bound HTML/XHTML table

                                                           //     Methods
     this.length = m_length;                              //     Page length
     this.page = m_page;                                   //     Current page number
     this.pagecount = m_pageCount;                   //     Calculate page count
     this.recordcount = m_recordCount;               //     "ADO recordset" recordcount
     this.showPage = m_showPage;                         //     Show current page
     this.showFirst = m_showFirst;                   //     "ADO recordset" movefirst
     this.showLast = m_showLast;                         //     "ADO recordset" movelast
     this.showNext = m_showNext;                         //     "ADO recordset" movenext
     this.showPrevious = m_showPrevious;               //     "ADO recordset" moveprevious

     function m_showPage() {
          /* Function:          m_showPage
             Creation Date:     April 25, 2003
             Programmer:          Edmond Woychowsky
             Purpose:              The purpose of this function is to show the
                                   current page's information.  This is accomplished
                                   by cloning the applicable nodes from the "full"
                                  Data Island to the "bound" Data Island.

             Update Date:       Programmer:              Description:
             May 13, 2003            Edmond Woychowsky          Modified to invoke m_recordCount()
                                                                to compute current record count.
          */

          var objRoot = document.createElement('root');
          var objXML = null;                              //     XML DOM for IE

          if(!blnInitialize)
               initialize(this.bound,this.full,this.table);

          this.full = document.getElementById(strXML);
          this.bound = document.getElementById(strBound);

                                                            //     Remove existing nodes
          try {
               document.getElementById(strTable).innerHTML = objInitialTable.innerHTML;
          }
          catch(e) { }

          try {
               for(var i=0;i < this.bound.childNodes.length;i++)
                    this.bound.removeChild(this.bound.childNodes.item(i));
          }
          catch(e) { }

                                                            //     Add up to this.length nodes
          for(var i=intAbsolutePosition;i < (intAbsolutePosition + intLength);i++)
               if(i > (m_recordCount() - 1))
                    break;
               else {
                    try {                                   //     Unique Mozilla logic
                         objRoot.appendChild(this.full.getElementsByTagName(objCommonAncestor).item(i).cloneNode(true));
                    }
                    catch(e) {                              //     Unique IE logic
                         if(i == intAbsolutePosition) {
                              objXML = new ActiveXObject('MSXML.DOMDocument');
                              objRoot = objXML.createElement('root');
                         }

                         objRoot.appendChild(this.full.XMLDocument.getElementsByTagName(objCommonAncestor).item(i).cloneNode(true));
                   }
               }

          this.bound.appendChild(objRoot);

          MozillaDSO();                                   //     Mozilla bind logic
     }

     function m_showFirst() {
          /* Function:          m_showFirst
             Creation Date:     April 25, 2003
             Programmer:          Edmond Woychowsky
             Purpose:               The purpose of this function is to show the
                                   first logical page.

             Update Date:       Programmer:              Description:
          */

          intAbsolutePosition = 0;                    //     Set absolute position

          m_showPage();                                   //     Show page
     }

     function m_showLast() {
          /* Function:          m_showLast
             Creation Date:     April 25, 2003
             Programmer:          Edmond Woychowsky
             Purpose:               The purpose of this function is to show the
                                   last logical page.

             Update Date:       Programmer:              Description:
          */

          intAbsolutePosition = (m_pageCount() - 1) * m_length();

          m_showPage();                                   //     Show page
     }

     function m_showNext() {
          /* Function:          m_showNext
             Creation Date:     April 25, 2003
             Programmer:          Edmond Woychowsky
             Purpose:               The purpose of this function is to show the
                                  next logical page.

             Update Date:       Programmer:              Description:
          */

          if(m_page() < m_pageCount())
               intAbsolutePosition += intLength;     //     Set absolute position

          m_showPage();                                   //     Show page
     }

     function m_showPrevious() {
          /* Function:          m_showPrevious
             Creation Date:     April 25, 2003
             Programmer:          Edmond Woychowsky
            Purpose:               The purpose of this function is to show the
                                   previous logical page.

             Update Date:       Programmer:              Description:
          */

          if(m_page() > 1)
              intAbsolutePosition -= intLength;     //     Set absolute position

          m_showPage();                                   //     Show page
     }

     function m_length() {
          /* Function:          m_length
             Creation Date:     April 25, 2003
             Programmer:          Edmond Woychowsky
             Purpose:               The purpose of this function is to set or get
                                   the logical page length.

             Update Date:       Programmer:             Description:
          */

          if(arguments.length > 0)
               intLength = parseInt(arguments[0],10);
          else
               return intLength;
     }

     function m_page() {
          /* Function:          m_page
            Creation Date:     April 25, 2003
             Programmer:          Edmond Woychowsky
             Purpose:               The purpose of this function is to compute the
                                   current logical page number.

             Update Date:       Programmer:              Description:
          */

          return (parseInt((intAbsolutePosition / intLength),10) + 1);
     }

     function m_recordCount() {
          /* Function:          m_recordCount
             Creation Date:     April 25, 2003
             Programmer:          Edmond Woychowsky
             Purpose:               The purpose of this function is to compute the
                                   return the total number of "records" in the
                                  "full" XML Data Island.

             Update Date:       Programmer:              Description:
             May 13, 2003            Edmond Woychowsky          Modified to recompute due
                                                                 to possible deletes.   
          */

          if(!blnInitialize)
               initialize(this.bound,this.full,this.table);

          return document.getElementById(strXML).getElementsByTagName(objCommonAncestor).length;
     }

     function m_pageCount() {
          /* Function:          m_pageCount
               Creation Date:     April 25, 2003
               Programmer:          Edmond Woychowsky
               Purpose:               The purpose of this function is to compute the
                                    return the total number of logical pages.
  
               Update Date:       Programmer:              Description:
               May 13, 2003            Edmond Woychowsky          Modified to invoke m_recordCount()
                                                                  to compute current record count.
            */
  
            if(!blnInitialize)
                 initialize(this.bound,this.full,this.table);
  
            return parseInt((m_recordCount() + (intLength - 1)) / intLength,10);
       }
  
       function initialize(objBound,objXML,objTable) {
            /* Function:          initialize
               Creation Date:     April 25, 2003
               Programmer:          Edmond Woychowsky
               Purpose:               The purpose of this function is to perform the
                                     necessary housekeeping before paging can occur.
  
               Update Date:       Programmer:              Description:
            */
  
            var objNodeName = new collection();
            var arrNodeName;
  
            switch(true) {
                 case((objBound == null) && (objXML == null) && (objTable == null)):
                      alert('Error: bound, xml and table not set.');
  
                      break;
                 case((objBound == null) && (objXML == null)):
                      alert('Error: bound and xml not set.');
  
                      break;
                 case((objBound == null) && (objTable == null)):
                      alert('Error: bound and table not set.');
  
                      break;
                 case((objXML == null) && (objTable == null)):
                      alert('Error: xml and table not set.');
  
                      break;
                 case(objBound == null):
                      alert('Error: bound not set.');
  
                     break;
                 case(objXML == null):
                      alert('Error: xml not set.');
  
                      break;
                 case(objTable == null):
                      alert('Error: table not set.');
  
                      break;
                default:
                      for(var i=0;i < objTable.getElementsByTagName('input').length;i++)
                           if(objTable.getElementsByTagName('input').item(i).getAttribute('datafld') != null)
                                objNodeName.item(objTable.getElementsByTagName('input').item(i).getAttribute('datafld'),null);
  
                      for(var i=0;i < objTable.getElementsByTagName('div').length;i++)
                           if(objTable.getElementsByTagName('div').item(i).getAttribute('datafld') != null)
                                objNodeName.item(objTable.getElementsByTagName('div').item(i).getAttribute('datafld'),null);
  
                      for(var i=0;i < objTable.getElementsByTagName('span').length;i++)
                          if(objTable.getElementsByTagName('span').item(i).getAttribute('datafld') != null)
                                objNodeName.item(objTable.getElementsByTagName('span').item(i).getAttribute('datafld'),null);
  
                      arrNodeName = objNodeName.keys();
                      objNodeName = new collection();
  
                      for(var i=0;i < arrNodeName.length;i++)
                           objNodeName.item(objXML.getElementsByTagName(arrNodeName[i]).item(0).parentNode.nodeName,null);
  
                     if(objNodeName.keys().length != 1)
                           alert('Error: unsupported XML document structure.');
                      else {
                           objCommonAncestor = objNodeName.keys().join('');
  
                           blnInitialize = true;
                      }
  
                                                              //     Store node names
                      strBound = objBound.getAttribute('id');
                      strXML = objXML.getAttribute('id');
                      strTable = objTable.getAttribute('id');
  
                                                              //     Store initial table
                      objInitialTable = objTable.cloneNode(true);
  
                      break;
            }
       }
  }
  
  function MozillaDSO() {
    /* Function:      MozillaDSO
       Creation Date: April 16, 2003
       Programmer:    Edmond Woychowsky
       Purpose:       The purpose of this function is to perform binding of
                      XML Data Islands for Mozilla.  The logic herein is bypassed
                      for Microsoft Internet Explorer.
  
       Update Date:       Programmer:              Description:
    */
  
                                                   //  Global variables
    objXMLDI = new collection();                   //  XML data island collection
    objBound = new collection();                   //  Bound XHTML object collection
  
                                                   //  Local variables
    var objDatafld;                                //  Table datafld collection
    var objRow;                                    //  Table row
    var reWork = new RegExp('internet explorer','gi');
    var arrKeys = new Array();
    var intKey = 0;                                //  objBound collection key
    var intRows;                                   //  Row count
  
    if(!reWork.test(navigator.appName)) {
                                                   //  Locate data islands
      for(var i=0;i < document.getElementsByTagName('xml').length;i++)
        objXMLDI.add('#' + document.getElementsByTagName('xml').item(i).getAttribute('id'),document.getElementsByTagName('xml').item(i));
  
                                                   //  Locate bound nodes
      for(var i=0;i < document.getElementsByTagName('table').length;i++)
        if(document.getElementsByTagName('table').item(i).getAttribute('datasrc') != null) {
          objBound.add(intKey.toString(),new boundXML());
  
          objBound.item(intKey.toString()).datasrc = document.getElementsByTagName('table').item(i).getAttribute('datasrc');
          objBound.item(intKey.toString()).node = document.getElementsByTagName('table').item(i);
          objBound.item(intKey.toString()).nodeName = document.getElementsByTagName('table').item(i).nodeName;
  
          objDatafld = new collection();           //  Reset collection;
          intRows = 0;                             //  Reset row count
  
                                                   //  Remove all rows
          if(objBound.item(intKey.toString()).node.getElementsByTagName('tr').length != 0) {
            for(var j=0;j < objBound.item(intKey.toString()).node.getElementsByTagName('tr').length;j++)
              objRow = objBound.item(intKey.toString()).node.lastChild.removeChild(objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j));
  
              for(var j=0;j < objBound.item(intKey.toString()).node.getElementsByTagName('tr').length;j++)
                objRow = objBound.item(intKey.toString()).node.lastChild.removeChild(objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j));
          }
  
                                                   //  Determine bound nodes
          for(var j=0;j < objRow.getElementsByTagName('input').length;j++)
            if(!objDatafld.exists(objRow.getElementsByTagName('input').item(j).getAttribute('datafld')))
              objDatafld.item(objRow.getElementsByTagName('input').item(j).getAttribute('datafld'),null);
  
          for(var j=0;j < objRow.getElementsByTagName('div').length;j++)
            if(!objDatafld.exists(objRow.getElementsByTagName('div').item(j).getAttribute('datafld')))
              objDatafld.item(objRow.getElementsByTagName('div').item(j).getAttribute('datafld'),null);
  
          for(var j=0;j < objRow.getElementsByTagName('span').length;j++)
            if(!objDatafld.exists(objRow.getElementsByTagName('span').item(j).getAttribute('datafld')))
              objDatafld.item(objRow.getElementsByTagName('span').item(j).getAttribute('datafld'),null);
  
          arrKeys = objDatafld.keys();
  
                                                   //  Determine row count
          for(var j=0;j < arrKeys.length;j++)
            if(intRows < objXMLDI.item(objBound.item(intKey.toString()).datasrc).getElementsByTagName(arrKeys[0]).length)
              intRows = objXMLDI.item(objBound.item(intKey.toString()).datasrc).getElementsByTagName(arrKeys[0]).length;
  
          for(var j=0;j < intRows;j++)
            objBound.item(intKey.toString()).node.lastChild.appendChild(objRow.cloneNode(true));
  
                                                   //  Rebuild table and bind
          for(var j=0;j < objBound.item(intKey.toString()).node.getElementsByTagName('tr').length;j++)
            for(var k=0;k < objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').length;k++)
              for(var l=0;l < objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.length;l++)
                switch(objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).nodeName.toLowerCase()) {
                  case('input'):
                        try {
                     if(objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('type') != 'checkbox')
                        objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).value = objXMLDI.item(objBound.item(intKey.toString()).datasrc).getElementsByTagName(objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('datafld')).item(j).firstChild.nodeValue;
                      else
                        objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).checked = eval(objXMLDI.item(objBound.item(intKey.toString()).datasrc).getElementsByTagName(objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('datafld')).item(j).firstChild.nodeValue);
                    }
                    catch(e) { }
  
                    if(objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('type') != 'checkbox')
                      objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).onchange = new Function('try { objXMLDI.item(\'' + objBound.item(intKey.toString()).datasrc + '\').getElementsByTagName(\'' + objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('datafld') + '\').item(' + j.toString() + ').firstChild.nodeValue = this.value } catch(e) { objXMLDI.item(\'' + objBound.item(intKey.toString()).datasrc + '\').getElementsByTagName(\'' + objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('datafld') + '\').item(' + j.toString() + ').appendChild(document.createTextNode(this.value)) };MozillaDSO;');
                    else
                      objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).onchange = new Function('try { objXMLDI.item(\'' + objBound.item(intKey.toString()).datasrc + '\').getElementsByTagName(\'' + objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('datafld') + '\').item(' + j.toString() + ').firstChild.nodeValue = this.checked } catch(e) { objXMLDI.item(\'' + objBound.item(intKey.toString()).datasrc + '\').getElementsByTagName(\'' + objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('datafld') + '\').item(' + j.toString() + ').appendChild(document.createTextNode(this.checked)) };MozillaDSO;');
  
                    break;
                  case('div'):
                 case('span'):
                    try {                        //  Text node exists
                      objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).firstChild.nodeValue = objXMLDI.item(objBound.item(intKey.toString()).datasrc).getElementsByTagName(objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('datafld')).item(j).firstChild.nodeValue;
                    }
                    catch(e) {                   //  Create text node
                      try {
                        objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).appendChild(document.createTextNode(objXMLDI.item(objBound.item(intKey.toString()).datasrc).getElementsByTagName(objBound.item(intKey.toString()).node.getElementsByTagName('tr').item(j).getElementsByTagName('td').item(k).childNodes.item(l).getAttribute('datafld')).item(j).firstChild.nodeValue));
                      }
                      catch(e) { }
                    }
  
                    break;
                }
  
                ++intKey;
        }
  
                                                   //  Non-tabular datasrc/datafld
        for(var i=0;i < document.getElementsByTagName('input').length;i++)
          if(document.getElementsByTagName('input').item(i).getAttribute('datafld') != null) {
            objBound.add(intKey.toString(),new boundXML());
  
            if(document.getElementsByTagName('input').item(i).getAttribute('datasrc') != null)
              objBound.item(intKey.toString()).datasrc = document.getElementsByTagName('input').item(i).getAttribute('datasrc');
  
            objBound.item(intKey.toString()).datafld = document.getElementsByTagName('input').item(i).getAttribute('datafld');
            objBound.item(intKey.toString()).node = document.getElementsByTagName('input').item(i);
            objBound.item(intKey.toString()).nodeName = document.getElementsByTagName('input').item(i).nodeName;
  
            ++intKey;
          }
  
        for(var i=0;i < document.getElementsByTagName('div').length;i++)
          if(document.getElementsByTagName('div').item(i).getAttribute('datafld') != null) {
            objBound.add(intKey.toString(),new boundXML());
  
            if(document.getElementsByTagName('div').item(i).getAttribute('datasrc') != null)
              objBound.item(intKey.toString()).datasrc = document.getElementsByTagName('div').item(i).getAttribute('datasrc');
  
            objBound.item(intKey.toString()).datafld = document.getElementsByTagName('div').item(i).getAttribute('datafld');
            objBound.item(intKey.toString()).node = document.getElementsByTagName('div').item(i);
            objBound.item(intKey.toString()).nodeName = document.getElementsByTagName('div').item(i).nodeName;
  
            ++intKey;
          }
  
        for(var i=0;i < document.getElementsByTagName('span').length;i++)
          if(document.getElementsByTagName('span').item(i).getAttribute('datafld') != null) {
            objBound.add(intKey.toString(),new boundXML());
  
            if(document.getElementsByTagName('span').item(i).getAttribute('datasrc') != null)
              objBound.item(intKey.toString()).datasrc = document.getElementsByTagName('span').item(i).getAttribute('datasrc');
  
            objBound.item(intKey.toString()).datafld = document.getElementsByTagName('span').item(i).getAttribute('datafld');
            objBound.item(intKey.toString()).node = document.getElementsByTagName('span').item(i);
            objBound.item(intKey.toString()).nodeName = document.getElementsByTagName('span').item(i).nodeName;
  
            ++intKey;
          }
  
        arrKeys = objBound.keys();
  
                                                  //  Handle non-tabular binds
        for(var i=0;i < arrKeys.length;i++)
          switch(objBound.item(arrKeys[i]).nodeName.toLowerCase()) {
            case('table'):
              objBound.item(arrKeys[i]).rows = new Array();
  
              break;
            case('input'):
              try {
                if(typeof(objBound.item(arrKeys[i]).datasrc) == 'string') {
                  try {
                    if(objBound.item(arrKeys[i]).node.getAttribute('type') != 'checkbox')
                      objBound.item(arrKeys[i]).node.value = objXMLDI.item(objBound.item(arrKeys[i]).datasrc).getElementsByTagName(objBound.item(arrKeys[i]).datafld).item(0).firstChild.nodeValue;
                    else
                      objBound.item(arrKeys[i]).node.checked = eval(objXMLDI.item(objBound.item(arrKeys[i]).datasrc).getElementsByTagName(objBound.item(arrKeys[i]).datafld).item(0).firstChild.nodeValue);
                  }
                  catch(e) { }
  
                      if(objBound.item(arrKeys[i]).node.getAttribute('type') != 'checkbox')
                    objBound.item(arrKeys[i]).node.onchange = new Function('try { objXMLDI.item(this.getAttribute(\'datasrc\')).getElementsByTagName(this.getAttribute(\'datafld\')).item(0).firstChild.nodeValue = this.value } catch(e) { objXMLDI.item(this.getAttribute(\'datasrc\')).getElementsByTagName(this.getAttribute(\'datafld\')).item(0).appendChild(document.createTextNode(this.value)) };MozillaDSO()');
                  else
                    objBound.item(arrKeys[i]).node.onclick = new Function('try { objXMLDI.item(this.getAttribute(\'datasrc\')).getElementsByTagName(this.getAttribute(\'datafld\')).item(0).firstChild.nodeValue = this.checked } catch(e) { objXMLDI.item(this.getAttribute(\'datasrc\')).getElementsByTagName(this.getAttribute(\'datafld\')).item(0).appendChild(document.createTextNode(this.checked)) };MozillaDSO()');
                }
              }
              catch(e) { }
  
              break;
            case('div'):
            case('span'):
              if(typeof(objBound.item(arrKeys[i]).datasrc) == 'string') {
                try {                              //  Text node exists
                  objBound.item(arrKeys[i]).node.firstChild.nodeValue = objXMLDI.item(objBound.item(arrKeys[i]).datasrc).getElementsByTagName(objBound.item(arrKeys[i]).datafld).item(0).firstChild.nodeValue;
                }
                catch(e) {                         //  Create text node
                  try {
                    objBound.item(arrKeys[i]).node.appendChild(document.createTextNode(objXMLDI.item(objBound.item(arrKeys[i]).datasrc).getElementsByTagName(objBound.item(arrKeys[i]).datafld).item(0).firstChild.nodeValue));
                  }
                  catch(e) { }
               }
              }
  
              break;
            default:
              alert('Error: Unsupported HTML Element - ' + objBound.item(arrKeys[i]).nodeName.toLowerCase());
  
              break;
          }
      }
  
    function boundXML() {
      var datasrc = null;                          //  Data source (string)
      var datafld = null;                          //  Data field (string)
      var node = null;                             //  XHTML node (object)
      var nodeName = null;                         //  Node name (string)
    }
  }
  
  function collection() {
    /* Function:      collection
       Creation Date: August 16, 2002
       Programmer:    Edmond Woychowsky
       Purpose:       The purpose of this class is to define the collection
                      object associative array.
  
       Update Date:       Programmer:              Description:
    */
  
                                                   //  Properties
    this.objcollection = new Object;               //  Associative array
    this.count = 0;                               //  Total numbers of items
  
                                                   //  Methods
    this.add = colAdd;                             //  Add method
    this.exists = colExists;                       //  Exists method
    this.item = colItem;                          //  Item method
    this.removeAll = colRemoveAll;                 //  Remove all method
    this.remove = colRemove;                       //  Remove method
    this.keys = colKeys;                           //  Keys method
  
    function colAdd(strKey,strItem) {
      /* Function:      colAdd
         Creation Date: August 16, 2002
         Programmer:    Edmond Woychowsky
         Purpose:       The purpose of this function is to add an item to
                        the collection object.
  
        Update Date:       Programmer:              Description:
      */
  
      if(typeof(this.objcollection[strKey]) == 'undefined')
        ++this.count;
  
        this.objcollection[strKey] = strItem;
    }
  
    function colExists(strKey) {
      /* Function:      colExists
         Creation Date: August 16, 2002
         Programmer:    Edmond Woychowsky
         Purpose:       The purpose of this function is to return a boolean
                        indicating where or not a key exists in the
                        collection object.
  
         Update Date:       Programmer:              Description:
      */
  
      if(typeof(this.objcollection[strKey]) == 'undefined')
        return false;
      else
        return true;
    }
  
    function colItem(strKey,strItem) {
      /* Function:     colItem
         Creation Date: August 16, 2002
         Programmer:    Edmond Woychowsky
         Purpose:       The purpose of this function is to either set or get
                        an item to or from the collection object.
  
         Update Date:       Programmer:              Description:
      */
  
      if(typeof(strItem) == 'undefined')
        return this.objcollection[strKey];
      else {
        if(typeof(this.objcollection[strKey]) == 'undefined')
          ++this.count;
  
        this.objcollection[strKey] = strItem;
      }
    }
  
    function colRemoveAll() {
      /* Function:      colRemoveAll
         Creation Date: August 16, 2002
         Programmer:    Edmond Woychowsky
         Purpose:       The purpose of this function is to remove all keys
                        and items from the collection object and set the
                        item count to zero.
  
         Update Date:       Programmer:              Description:
      */
  
      this.objcollection = new Object;
      this.count = 0;
    }
  
    function colRemove(strKey) {
      /* Function:      colRemove
         Creation Date: August 16, 2002
         Programmer:    Edmond Woychowsky
         Purpose:       The purpose of this function is to remove a single
                        item and it's associated key from the collection
                        object and decrement the count by one.
  
         Update Date:       Programmer:              Description:
      */
  
      if(typeof(strItem) != 'undefined') {
        this.objcollection[strKey] == 'undefined';
        --this.count;
      }
    }
  
    function colKeys() {
      /* Function:      colKeys
         Creation Date: August 16, 2002
         Programmer:    Edmond Woychowsky
         Purpose:       The purpose of this function is to return an array
                       consisting of the collection object's keys.
  
         Update Date:       Programmer:              Description:
      */
  
      var arrWork = new Array();
      var strKey;
  
      for(strKey in this.objcollection)
        if(this.objcollection[strKey] != 'undefined')
          arrWork.push(strKey);
  
      return arrWork;
    }
  }
  // ]]> -->
  </script>
  </head>
    <body onload="setEvents()">
       <table width="100%" border="0">
            <tr>
                 <td width="100%" align="center" bgcolor="black" >
                     <font color="white" size="8pt"><%=strTitle %></font>
                 </td>
            </tr>
       </table>
       <table width="100%" height="450" border="0">
         <tr>
           <td align="left" valign="top">
             <table id="boundTable" datasrc="#xmlWindow" width="100%" border="1" onreadystatechange="ieBusTable(this)">
              <thead>
                <td bgcolor="#FFFFEE" width="5%"><b>Delete</b></td>
                <td bgcolor="#FFFFEE" width="5%"><b>Line</b></td>
                <td bgcolor="#FFFFEE" width="20%"><b>Item number</b></td>
                <td bgcolor="#FFFFEE" width="30%"><b>Description</b></td>
                <td bgcolor="#FFFFEE" width="25%"><b>Weight</b></td>
                <td bgcolor="#FFFFEE" width="7%"><b>Quantity</b></td>
                <td bgcolor="#FFFFEE" width="8%"><b>Unit Price</b></td>
              </thead>
              <tr>
                <td align="center" valign="top">
                      <input type="hidden" id="line" name="line" datafld="line" />
                      <input type="checkbox" id="selected" name="selected" datafld="selected" />
                </td>
                <td align="right" valign="top">
                  <div datafld="line"></div>
                </td>
                <td valign="top">
                  <div datafld="item"></div>
                </td>
                <td valign="top">
                  <div datafld="description"></div>
                </td>
                <td valign="top">
                  <div datafld="weight"></div>
                </td>
                <td align="center" valign="top">
                      <input type="text" id="quantity" name="quantity" datafld="quantity" style="text-align: right" size="5" maxlength="3" />
                </td>
                <td align="right" valign="top">
                  <div datafld="unitprice"></div>
                </td>
              </tr>
            </table>
           </td>
         </tr>
         <tr>
           <td align="bottom">
             <table width="100%" border="0">
              <tr>
                <td align="right">
                     Page <span id="currentpage"></span> of <span id="totalpages"></span>
                </td>
              </tr>
            </table>
           </td>
         </tr>
       </table>
      <p />
      <table width="100%" border="0">
        <tr>
          <td width="12%">
            <input type="button" name="First" id="First" value="First" onclick="document.body.style.cursor = 'wait';objPage.showFirst();document.getElementById('currentpage').lastChild.nodeValue = objPage.page();document.body.style.cursor = 'auto'" />
          </td>
          <td width="12%">
            <input type="button" name="Next" id="Next" value="Next" onclick="document.body.style.cursor = 'wait';objPage.showNext();document.getElementById('currentpage').lastChild.nodeValue = objPage.page();document.body.style.cursor = 'auto'" />
          </td>
          <td width="12%">
            <input type="button" name="Previous" id="Previous" value="Previous" onclick="document.body.style.cursor = 'wait';objPage.showPrevious();document.getElementById('currentpage').lastChild.nodeValue = objPage.page();document.body.style.cursor = 'auto'" />
          </td>
          <td width="12%">
            <input type="button" name="Last" id="Last" value="Last" onclick="document.body.style.cursor = 'wait';objPage.showLast();document.getElementById('currentpage').lastChild.nodeValue = objPage.page();document.body.style.cursor = 'auto'" />
          </td>
          <td width="12%"> </td>
          <td width="12%">
            <input type="button" name="Update" id="Update" value="Update" onclick="document.body.style.cursor = 'wait';update();document.body.style.cursor = 'auto'" />
          </td>
          <td> </td>
        </tr>
      </table>
      <xml id="xmlWindow" async="false">
      </xml>
      <xml id="xmlFull" async="false"><%=Session("shoppingcart") %></xml>
    </body>
  </html>
  </td>
 </tr>
</table>

</body>

</html>

    服務(wù)器端
    一旦客戶端的代碼編寫完成,就到了把注意力集中到購(gòu)物車的服務(wù)器端上了。創(chuàng)建購(gòu)物車的機(jī)制因電子商務(wù)系統(tǒng)的差異而有所不同,但是XLM數(shù)據(jù)島的基本布局就像下面列表D里面的一樣。

<%@ Language=JScript %>

 <%

 /* ASP:               xmlServer

 Creation Date: May 12, 2003

 Programmer:    Edmond Woychowsky

 Purpose:       The purpose of this script is to handle client-side changes

 to the contents of an XML "shopping cart".


 Update Date:       Programmer:              Description:

 */

 var objXML = new ActiveXObject('MSXML2.FreeThreadedDOMDocument.4.0');

 objXML.loadXML(unescape(Request.ServerVariables.Item('HTTP_request')));


 if(objXML.parseError == 0) {                    //     Delete rows

 for(var i=0;i < objXML.getElementsByTagName('row').length;i++)

 if(eval(objXML.getElementsByTagName('selected').item(i).text)) {

 objXML.getElementsByTagName('root').item(0).removeChild(objXML.getElementsByTagName('row').item(i));


 --i;

 }


 //     Resequence lines

 for(var i=0;i < objXML.getElementsByTagName('line').length;i++)

 objXML.getElementsByTagName('line').item(i).text = (i + 1).toString();


 Session('shoppingcart') = objXML.xml;     //     Update session variable

 }


 Response.Write(Session('shoppingcart'));     //     Respond to client


 objXML = null;

 //     Clean up

 %>

    由于這只是一個(gè)演示版的應(yīng)用程序,所以客戶端頁(yè)面代碼之后部分(見(jiàn)列表C)并沒(méi)有顯示出購(gòu)物車最初是如何創(chuàng)建的,也沒(méi)有顯示任何數(shù)據(jù)庫(kù)邏輯。它把重點(diǎn)放在了購(gòu)物車的操控上(見(jiàn)列表D)。當(dāng)?shù)谝患锲繁贿x中的時(shí)候,利用XML文檔對(duì)象模型(DOM),或者通過(guò)使用ADO的保存方法和XSLT就可以完成創(chuàng)建購(gòu)物車了。以后的物品簡(jiǎn)單地通過(guò)使用DOM或者XSLT就可以加在后面了。

    檢驗(yàn)過(guò)程就是數(shù)據(jù)庫(kù)邏輯所在的地方。我使用DOM來(lái)瀏覽XML購(gòu)物車,使用一個(gè)Oracle存儲(chǔ)過(guò)程來(lái)更新或者添加數(shù)據(jù)行,這真的對(duì)那些使用SQL服務(wù)器或者M(jìn)ySQL的購(gòu)物車沒(méi)有什么幫助。

    第二次會(huì)更好
    使用XML數(shù)據(jù)島比較容易讓HTML具有清爽的外觀。這里沒(méi)有一行接一行的服務(wù)器端代碼,也沒(méi)有嵌入在循環(huán)里的單行HTML,這里有的是一行HTML。當(dāng)有人在你剛剛完成購(gòu)物車應(yīng)用程序就建議添加一個(gè)數(shù)據(jù)列的時(shí)候,這個(gè)方法可以幫助你避免一些開(kāi)發(fā)人員需要面對(duì)的維護(hù)惡夢(mèng)。

溫馨提示:喜歡本站的話,請(qǐng)收藏一下本站!

本類教程下載

系統(tǒng)下載排行

狠狠爱成人网_日韩一级在线_国产综合自拍_亚洲精品韩国_亚洲视频导航_麻豆成人在线播放_欧美jjzz_一区在线视频观看_美脚丝袜一区二区三区在线观看_欧美91视频
久久深夜福利| 亚洲日本va在线观看| 欧美成人video| 国产欧美中文在线| 亚洲午夜久久久久久久久电影院 | 欧美日韩专区在线| 精品国产三级电影在线观看| 国产调教视频一区| 亚洲日本在线天堂| 日本视频一区二区| 91豆麻精品91久久久久久| 欧美在线播放一区| 风流少妇一区二区| 一区二区毛片| 欧美mv日韩mv亚洲| 蜜臀av亚洲一区中文字幕| 欧美一区免费视频| 精品制服美女丁香| 日韩高清在线一区| 日韩av电影天堂| 亚洲va欧美va人人爽午夜| 亚洲国产精品精华液ab| 欧美电影免费观看高清完整版在| 日本精品一区二区三区四区的功能| 欧美日韩 国产精品| 女人色偷偷aa久久天堂| av激情成人网| 激情久久久久久久| 亚洲视频福利| 国产亚洲欧美一区二区| 亚洲在线视频| 欧美系列亚洲系列| 欧美一区二区精品在线| 日韩免费一区二区三区在线播放| 日韩欧美国产综合| 亚洲国产视频在线| 一二三区精品视频| 无码av免费一区二区三区试看 | 亚洲一区尤物| 69久久99精品久久久久婷婷| 亚洲一区二区三区午夜| 国产欧美日韩中文久久| 一区二区三区免费网站| www.欧美.com| 日本韩国欧美在线| 久久精品国产综合精品| 一本久久a久久精品亚洲| 91国产免费看| 久久影音资源网| 中文字幕不卡三区| 亚洲综合免费观看高清完整版| 亚洲午夜一区二区| 久久久久久久久蜜桃| 久久久999| 麻豆精品国产传媒mv男同 | www成人在线观看| 999亚洲国产精| 捆绑调教一区二区三区| 26uuu精品一区二区| 亚洲一区二区动漫| 波多野结衣精品在线| 亚洲欧美一区二区三区久本道91| 欧美亚一区二区| 91小宝寻花一区二区三区| 亚洲欧美怡红院| 欧美视频一区在线| 亚洲va国产天堂va久久en| 国产日韩欧美一区在线| 1024成人| 久久av一区二区| 日韩视频在线播放| 成人午夜精品一区二区三区| 亚洲一线二线三线视频| 国产精品免费av| 欧美一级电影网站| 91极品视觉盛宴| 中日韩男男gay无套| 91蜜桃视频在线| 久久国产精品高清| 青青草原综合久久大伊人精品 | 婷婷久久综合九色国产成人| 久久这里只有精品6| 欧美视频中文一区二区三区在线观看| 欧美日韩免费| 午夜电影亚洲| 欧美日韩国产综合草草| 国内外成人在线| 国产性色一区二区| 欧美日韩无遮挡| 樱花影视一区二区| 欧美日韩成人一区| 高清av一区二区| 一区二区三区资源| 欧美男生操女生| 国产精品伊人日日| 91免费视频网| 美腿丝袜亚洲一区| 在线不卡免费欧美| 欧美精品三级| 91原创在线视频| 中文字幕佐山爱一区二区免费| 色婷婷av一区二区| 不卡电影一区二区三区| 一区二区三区四区乱视频| 欧美日本在线一区| 伊人久久成人| 福利一区二区在线观看| 亚洲一区免费在线观看| 日韩网站在线看片你懂的| 亚洲在线观看| 亚洲一级二级| 91免费视频网址| 亚洲综合日本| 久久精品男女| 久久蜜桃av一区二区天堂 | 精品视频在线免费看| 欧美三级中文字幕| 久久综合九色综合欧美亚洲| 亚洲久草在线视频| 麻豆精品一二三| 91麻豆国产香蕉久久精品| 精品999日本| 欧美日韩国产免费一区二区| 久久久久久亚洲综合| 麻豆精品一区二区综合av| 国产精品国产精品| 欧美精品自拍偷拍| 亚洲综合自拍偷拍| 成人综合在线网站| 先锋影音国产一区| 国产精品亲子乱子伦xxxx裸| 久草这里只有精品视频| 国产精品美女诱惑| 中文字幕久久午夜不卡| 欧美精品久久久久久久多人混战 | 99精品视频免费| 男女精品视频| 欧美一区二区三区日韩视频| 日韩免费成人网| 亚洲人成小说网站色在线 | 精品伦理精品一区| 欧美激情在线观看视频免费| 亚洲免费高清视频在线| 天天免费综合色| 免费人成黄页网站在线一区二区| 日韩影院免费视频| 99久久精品国产毛片| 在线观看日韩av电影| 国产精品国产三级国产aⅴ入口| 午夜视频在线观看一区二区 | 国一区二区在线观看| 久久一本综合频道| 在线欧美日韩精品| 麻豆91精品视频| 欧美日韩精品一区视频| 国产毛片精品视频| 精品欧美一区二区在线观看| 99re6这里只有精品视频在线观看| 精品国产乱码久久久久久影片| 99vv1com这只有精品| 久久久久国产精品麻豆ai换脸| 欧美一区二区三区四区在线观看地址| 精品国产在天天线2019| 99热99精品| 一区二区三区在线视频播放| 91成人免费在线视频| 成人动漫一区二区三区| 久久精品人人做| 亚洲一区黄色| 成人黄色电影在线| 亚洲色图色小说| 欧美一区二区三区公司| 午夜精品区一区二区三| 青草av.久久免费一区| 亚洲精品一区二区三区蜜桃下载 | 亚洲第一福利视频在线| 欧美电影免费观看高清完整版在线 | 狠狠爱综合网| 亚洲图片你懂的| 亚洲欧洲综合| 亚洲一区在线视频| 国产精品伊人色| 夜夜嗨av一区二区三区中文字幕| 欧美精品v国产精品v日韩精品| 欧美三级小说| 狠狠色伊人亚洲综合成人| 亚洲精品乱码久久久久久| 精品成人一区二区三区| 色哟哟一区二区| a91a精品视频在线观看| 不卡一区二区在线| 亚洲成人中文| 91色porny在线视频| 欧美一级专区免费大片| 欧美va天堂在线| 亚洲成人三级小说| 欧美影院午夜播放| 午夜精品999| 久久99九九99精品| 久久在线免费观看|