我想生成如下文件:
<?xml version="1.0" encoding="GB2312" ?>
- <Root>
- <CertificateInfo>
<Name>kkkk</Name>
<CType>aaaa</CType>
<CeNo>30924001</CeNo>
<BDate>1984-09-12</BthDate>
</CertificateInfo>
</Root>如何生成?使用DOMDocument1或其它方法生成XML文件都行。请给出原代码,谢谢!
<?xml version="1.0" encoding="GB2312" ?>
- <Root>
- <CertificateInfo>
<Name>kkkk</Name>
<CType>aaaa</CType>
<CeNo>30924001</CeNo>
<BDate>1984-09-12</BthDate>
</CertificateInfo>
</Root>如何生成?使用DOMDocument1或其它方法生成XML文件都行。请给出原代码,谢谢!
<?xml version="1.0" encoding="GB2312" ?>
- <Root>
- <CertificateInfo>
<Name>kkkk</Name>
<CType>aaaa</CType>
<CeNo>30924001</CeNo>
<BDate>1984-09-12</BthDate>
</CertificateInfo>
</Root>如何生成?使用DOMDocument1或其它方法生成XML文件都行。请给出原代码,谢谢!
var
xXMLdoc:Ixmldocument;
Root,child_Node:Ixmlnode;
begin
xXMLdoc:=Ixmldocument.create(self);
xXMLdoc.active:=false;
xXMLdoc.xml.clear;
xXMLdoc.active:=true;
xXMLdoc.encoding:='GB2312';
Root:=xXMLdoc.addchild('Root');
child_Node:=Root.addchild('CertificateInfo');
child_Node.SetAttributeNS('Name','','kkkk');
child_Node.SetAttributeNS('CType','','aaaa');
child_Node.SetAttributeNS('CeNo','','30924001');
child_Node.SetAttributeNS('BDate','','1984-09-12');
memo1.lines.text:=xXMLdoc.xml.text;
变成 xXMLdoc:=Txmldocument.create(self);
所以无法引用。
dephi7.0啊