创建并添加XML元素
JScript
The following JScript code creates a DOMDocument
object, and then uses that DOMDocument
object to create an IXMLDOMElement
object, which is then appended to the DOMDocument
to be the root element of the document.
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.3.0");
var rootElement=xmlDoc.createElement("memo");
xmlDoc.appendChild(rootElement);
|
VBScript
Set xmlDoc = CreateObject("Msxml2.DOMDocument.3.0")
Set rootElement=xmlDoc.createElement("memo")
xmlDoc.appendChild(rootElement)
|