学无止境

<?xml   version= "1.0 "   encoding= "gb2312 "?> 
<File> 
    <aa> 
        <bb> bb </bb> 
    </aa> 
    <Handle> 客户端加密,服务器端解密 </Handle> 
    <FileId> 文件ID </FileId> 
    <FileName> 文件名 </FileName> 
    <FileSize> 文件大小 </FileSize> 
    <UploadDate> 上传日期 </UploadDate> 
    <UploadTime> 上传时间 </UploadTime> 
    <UploadMan> 上传人 </UploadMan> 
    <Note> 注释 </Note> 
</File> 
这是Delphi代码 
procedure   TForm1.Button1Click(Sender:   TObject); 
var   node:IXMLNode; 
begin 
    XMLDocument1.Active:=True; 
    node:=XMLDocument1.DocumentElement.ChildNodes.First.AddChild( 'tgp1c11 '); 
    node.Attributes[ 'class ']:= 'class '; 
    node.Attributes[ 'caption ']:= 'caption '; 
    node.Attributes[ 'left ']:= 'left '; 
    node.Attributes[ 'top ']:= 'top '; 
    node.Attributes[ 'width ']:= 'width '; 
    node.Text:= 'aaa '; 
    XMLDocument1.SaveToFile( 'c:\aa.xml '); 
end; 
下面是产生的XML文件 
<?xml   version= "1.0 "   encoding= "gb2312 "?> 
<File> 
<aa> 
<bb> bb </bb> 
<tgp1c11   class= "class "   caption= "caption "   left= "left "   top= "top "   width= "width "> aaa </tgp1c11> </aa> 
<Handle> 客户端加密,服务器端解密 </Handle> 
<FileId> 文件ID </FileId> 
<FileName> 文件名 </FileName> 
<FileSize> 文件大小 </FileSize> 
<UploadDate> 上传日期 </UploadDate> 
<UploadTime> 上传时间 </UploadTime> 
<UploadMan> 上传人 </UploadMan> 
<Note> 注释 </Note> 
</File> 

posted on 2011-09-07 15:48  DHT  阅读(417)  评论(0编辑  收藏  举报