• <label id="pxtpz"><meter id="pxtpz"></meter></label>
      1. <span id="pxtpz"><optgroup id="pxtpz"></optgroup></span>

        當前位置:雨林木風下載站 > 技術(shù)開發(fā)教程 > 詳細頁面

        將HTML表單數(shù)據(jù)存儲為XML格式 - 1

        將HTML表單數(shù)據(jù)存儲為XML格式 - 1

        更新時間:2022-04-26 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):

        如你熟知ASP,XML和HTML4。0,請讀下列示例

        將表單數(shù)據(jù)存為XML格式

          通常的,ASP中表單提交的數(shù)據(jù)一般被寫入數(shù)據(jù)庫。然而,如果你想讓發(fā)送數(shù)據(jù)更為簡便易行,那么,可以將它書寫為
        XML文件格式。這種方式對于在web上收集的數(shù)據(jù)更為有用。因為XML對于所用平臺來說非常的簡便,所以用不著轉(zhuǎn)換數(shù)據(jù)格
        式。

          將提交的數(shù)據(jù)寫為XML文檔,則需要通過Microsoft XMLDOM Object創(chuàng)建一個新的XML文檔。Microsoft XMLDOM Object
        擁有一個可擴展對象庫,通過它可以創(chuàng)建elements,attributes以及values,通過創(chuàng)建的這些項目則可以組成XML文檔。我
        無法將整個目標模型做個完整的介紹,因為它所包含的內(nèi)容太廣泛,對于將建成的網(wǎng)站來說,目標模型甚至通過自身也能
        組建一個相對完整的部份。

          在XMLDOM Object被創(chuàng)建出來之后,通過創(chuàng)建目標(此目標是關(guān)于組成XML文檔中每一層的ELEMENTS而言)XML的結(jié)構(gòu)會
        被演示出來。接下來,會舉例說明XMLDOM是怎樣被創(chuàng)建出來的。創(chuàng)建root element之后,將它附加在XMLDOM文件上。然后
        創(chuàng)建child elements并附加在root element上,最后存儲文檔。

        演示Microsoft XMLDOM 對象

        <%

        Dim objDom
        Dim objRoot
        Dim objChild1
        Dim objChild2
        Dim objPI

        " XMLDOM 對象使用Server對象的CreateObject方法創(chuàng)建
        Set objDom = Server.CreateObject("Microsoft.XMLDOM")
        "使用XMLDOM的createElemnet方法創(chuàng)建一個IXMLDOMElement對象。
        "createElemnet方法又一個string參數(shù),這個string 表示該element的名稱。
        返回值被傳遞到objRoot變量。objRoot表示XML文檔的根元素.。

        Set objRoot = objDom.createElement("rootElement")

        "Use the appendChild Method of the XMLDOM Object to add the objRoot
        "Element Reference to the XML Document.

        objDom.appendChild objRoot

        "Now, following the same steps, you will create references to the
        "child elements for the XML Document. The only difference is, when the
        "child elements are appended to the document, you will call the
        "appendChild Method of the IXMLDOMElement Object rather than the
        "appendChild Method of the XMLDOM Object. By using the IXMLDOMElement
        "to append the children, you are differentiating (and applying tiered
        "structure to) the child elements from the root element.

        Set objChild1 = objDom.createElement("childElement1")
        objRoot.appendChild objChild1
        Set objChild1 = objDom.createElement("childElement2")
        objRoot.appendChild objChild2

        "The final step to take care of before saving this document is to add
        "an XML processing instruction. This is necessary so that XML parsers
        "will recognize this document as an XML document.

        Set objPI = objDom.createProcessingInstruction("xml","vertsion="1.0"")

        "Call the insertBefore Method of the XMLDOM Object in order to insert
        "the processing instruction before the root element (the zero element
        "in the XMLDOM childNodes Collection).

        objDom.insertBefore objPI, objDom.childNodes(0)

        "Calling the Save Method of the XMLDOM Object will save this XML
        "document to your disk drive. In this case, the document will be saved
        "to the "c:" drive and will be named "MyXMLDoc.xml". When saving an
        "XML document, if the file does not exist, it will be created. If it
        "does exist, it will be overwritten.

        objDom.Save "c:\MyXMLDoc.xml"

        %>


        溫馨提示:喜歡本站的話,請收藏一下本站!

        本類教程下載

        系統(tǒng)下載排行

        主站蜘蛛池模板: 亚洲偷自精品三十六区| 亚洲人成亚洲人成在线观看| 亚洲欧洲国产视频| 99精品视频在线免费观看| 亚洲精品二区国产综合野狼| 97在线视频免费公开视频| 国产亚洲精品精品国产亚洲综合| 日韩免费在线中文字幕| 亚洲国产精品一区二区三区久久| 在线播放免费人成视频网站| 国产亚洲欧洲Aⅴ综合一区| 2022免费国产精品福利在线| 亚洲午夜久久久影院伊人| 在线观看免费视频网站色| 亚洲av无码一区二区三区不卡| a级成人毛片免费图片| 久久国产精品亚洲综合| 一级毛片免费播放| 亚洲成人福利在线| 成人免费在线观看网站| 国产在亚洲线视频观看| 狠狠亚洲狠狠欧洲2019| 免费h视频在线观看| 亚洲美女视频一区| 嫩草影院在线免费观看| 免费无码午夜福利片69| 国产亚洲一区二区三区在线观看 | 青青草国产免费国产是公开| 中文字幕亚洲专区| 曰批全过程免费视频播放网站 | 国产精品亚洲精品日韩动图 | 免费吃奶摸下激烈视频| WWW免费视频在线观看播放| 亚洲日本中文字幕区| 毛片免费观看网站| 一本岛v免费不卡一二三区| 久久精品亚洲一区二区| 毛片免费vip会员在线看| aa级女人大片喷水视频免费| 亚洲av永久无码嘿嘿嘿| 亚洲精品无码99在线观看|