关于xml的问题
Private Sub CreateGBFile()
Dim DOM As DOMDocument
Dim Node As IXMLDOMNode
If Dir(App.Path & "\GB.xml") <> "" Then Kill App.Path & "\GB.xml"
Set DOM = New DOMDocument
Set Node = DOM.createElement("GB")
DOM.appendChild Node
~~~~~~~~~~~~~~~~~~~~
CreateNode Node, "Speed"
DOM.save App.Path & "\GB.xml"
End Sub
Private Sub CreateNode(pNode As IXMLDOMNode, Name As String, Optional Value As String)
Dim Node As IXMLDOMNode
Set Node = pNode.ownerDocument.createElement(Name)
Node.Text = Value
pNode.appendChild Node
End Sub
我的疑问是DOM.appendChild Node这句无论放在CreateNode前还是后,得到的结果都一样,为什么?