以下VBA代码生成<?xml version="1.0"?>
作为输出。为什么MSXML中的createProcessingInstruction生成不完整的输出?
Dim XML As New DomDocument
Dim pi As IXMLDOMProcessingInstruction
'.... some code that sets the root element of the document
Set pi = XML.createProcessingInstruction("xml", "version='1.0' encoding='UTF-8'")
XML.insertBefore pi, XML.documentElement
为什么encoding="UTF-8"
被遗漏了?
版本也是默认值。仍然在输出中。 – norbertB 2009-02-12 13:32:29
恩,谢谢你接受我的回答,但我倾向于认为Bobince是更好的人。显然,尽管看起来就像一个处理指令,<?xml不是一个,所以不要使用createProcessingInstruction。 – 2009-02-12 19:44:35