XMLDOM learning

xiaoxiao2021-03-06  105

Method XMLDOM obtained a node in the tree: nodeFromID and getElementByTagNamei.e: dim domdim nodelist As XMLDOMNodeListdim node As XMLDOMNodeDim i as Integer, length as integerset dom = CreateObject ( "microsoft.xmldom") doc.async = falsedom.load ( "filename.xml") set nodelist = dom.GtelementBytagname ("Page") length = Nodelist.LengthFor i = 0 to length set node = nodelist.Item () i msgbox node.xmlnext

Adding a node set node in an XML document = rootNode.childNodes.item (0) set newNode = myDocument.createElement ( "publisher") set rtnNode = node.insertBefore (newNode, node.lastChild) set textNode = myDocument.CreateTextNOde ( " People's Posts Publishing House ") Node.childNodex.Item (1) .appendchild (TextNode)

转载请注明原文地址:https://www.9cbs.com/read-126275.html

New Post(0)