No.1 - Create an XML Database Data.xml XML Version = "1.0"?> CACA name> 154222225 qq> root @ 3Ney .com email> record> No.2 - Create the object CreateObject to establish a Data.xml object first set Xmldoc = Server.createObjcet ("Microsoft.xmLDom") XmLDoc.Load (Server.MAppath " Data.xml ") No.3 - Select Node SelectNode You want to operate which node, must be positioned to this node, first look at this data.xml has several node ?? Use a recursive function: getnodes (XmldoC) Sub getnodes (node) Dim i response.write ("
NodeName: b>" & node.nodeename & "
nodetypeString: b>" & node.nodetypeString & "
NodeValue: b> "& node.nodevalue &"
text: b> "& node.text &"
node.childnodes.length: b> "& node. ChildNodes.Length & "") if node.childnodes.length <> 0 Then for i =
0 to node.childNodes.LENGTH-1 GetNodes (Node.childNodes (i)) Next End If End Sub After using this function, you can see that this DATA.XML has 10 node these Node can be a simple location: XmLDoc XMLDOC. childnodes (0) xmldoc.childnodes (1) xmldoc.childnodes (1) .childnodes (0) xmldoc.childnodes (1) .childnodes (0) .childnodes (0) xmldoc.childnodes (1) .childnodes (0) .childnodes (0) .Text Xmldoc.childNodes (1) .childNodes (0) .childNodes (1) xmldoc.childNodes (1) .childNodes (0) .childNodes (1) .Text xmldoc.childNodes (1) .childnodes (0) .childnodes (2) xmldoc.childNodes (1) .childnodes (0) .childNodes (2) .text is a simple location, there is a method, such as positioning xmldoc.selectsinglenode ("// name") Also: xmldoc.getElementsBytagname ("name"). Item (0) No.4 - Give node assignment (modifying the value of the node) learns the positioning node, use its properties, you can modify or assign, for example, to put The value of CACA is changed to Wawa Xmldoc.selectsinglenode ("// name"). Text = "WAWA" XMLDoc.save (Server.MAppath ("DATA.XML")) to get! No.5 - Create a new node CreatenewNode CreateElem ENT or CREATENODE ("" "," "), for example: new under Record, only one sentence is required: XmLDoc.selectsinglenode (" // record "). appendchild (xmldoc.createElement (" ")) Give Assign XMLDoc.selectsinglenode (" // Age "). Text =" 20 "XMLDoc.save (Server.MAppath (" DATA.XML ")) to get! No.6 - Delete a node DELETENODE You must clarify the parent of this node you want to delete, and this node's feature, for example: delete Node Xmldoc.selectsinglenode ("// Record"). RemoveChild (xmldoc.selectsinglenode ("qq")) For example: Delete the = CACA xmldoc.selectsinglenode ("// RECORDS"). RemoveChild (XmLDoc.selectsinglenode ("