六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

將HTML表單數據存儲為XML格式 - 1

[摘要]如你熟知ASP,XML和HTML4。0,請讀下列示例將表單數據存為XML格式  通常的,ASP中表單提交的數據一般被寫入數據庫。然而,如果你想讓發送數據更為簡便易行,那么,可以將它書寫為XML文件格...
如你熟知ASP,XML和HTML4。0,請讀下列示例

將表單數據存為XML格式

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

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

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

演示Microsoft XMLDOM 對象

<%

Dim objDom
Dim objRoot
Dim objChild1
Dim objChild2
Dim objPI

" XMLDOM 對象使用Server對象的CreateObject方法創建
Set objDom = Server.CreateObject("Microsoft.XMLDOM")
"使用XMLDOM的createElemnet方法創建一個IXMLDOMElement對象。
"createElemnet方法又一個string參數,這個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"

%>





主站蜘蛛池模板: 欧美在线观看一区二区三区 | 亚洲成av人影片在线观看 | 图片区欧美色图 | 日韩在线资源 | 色网站综合 | 亚洲美女视频一区 | 青青视频网站 | 青青在线免费观看 | 青青在线国产视频 | 欧美一级在线免费观看 | 性夜a爽黄爽| 天天综合网久久 | 中文字幕天堂最新版在线网 | 人人精品久久 | 亚洲有码区 | 日韩在线观看网址 | 五月婷婷激情四射 | 特级黄色毛片视频 | 日本亚洲欧美 | 亚洲欧美一区二区三区麻豆 | 午夜精品福利在线观看 | 亚洲激情视频 | 最新中文字幕一区二区乱码 | 中文字幕在线乱码免费毛片 | 午夜久久久精品 | 欧美性开放视频 | 欧美偷拍小视频 | 亚洲成a v人片在线看片 | 色婷婷综合久久久久中文 | 欧美视频第二页 | 日本亚欧乱色视频在线观看 | 日本一区二区视频在线观看 | 色天天网 | 欧美综合一区二区三区 | 中文亚洲 | 午夜国产精品影院在线观看 | 天天做夜夜爽 | 做受又硬又粗又免费视频 | 亚洲手机在线手机观看高清hd | 青草视频在线观看完整版 | 亚洲精品老司机在线观看 |