写XML文件注释
<?xml version="1.0" encoding="GB2312" ?>
<!--这里加这样一个注释如何加-->
<package>
<head>
<code_type>0</code_type>
<hospital_code>111111</hospital_code>
<create_time>2006-12-17</create_time>
</head>
....
....
写如上这样一个XML 文件, 想在<?xml version="1.0" encoding="GB2312" ?> 这句下面加一个注释,如何加的?
我的代码:
MDoc:TXMLDocument;
begin
MDoc:=TXMLDocument.Create(nil);
MDoc.Active := true; //激活XMLDoc
MDoc.Version := '1.0';
MDoc.Encoding := 'GB2312'; //设置字符集
//加入根结点
aNode:=MDoc.AddChild('package');
//加入子结点
aNode1:=aNode.AddChild('head');
aNode2:= aNode1.AddChild('code_type');
...
...
MDoc.CreateNode('注释',ntNotation,'') 这个是不是加注释的,不会用,报错,IDOMNode required