使用MSXML2 向xml文件添加简单的文本
比如,我想在创建XML文件后,将“ <?xml version= "1.0 " encoding= "GB2312 " ?> ”写到文件的开始,该如何做??
------解决方案--------------------Set pi = xmlDoc.createProcessingInstruction( "xml ", "version= " "1.0 " " encoding= " "GB2312 " " ")
xmlDoc.insertBefore pi, xmlDoc.childNodes.item(0)