漠
漠风
Unregistered / Unconfirmed
GUEST, unregistred user!
放一个TXMLDocument在form上。
procedure TForm1.Button1Click(Sender: TObject);
var
aNode, aValueNode: IXMLNode;
wStr: widestring;
begin
//+++++++++++++++++++++++++++++++++++++
//用TXmlDocument实现创建一个Xml文档
with XMLDocument1.XMLdo
begin
Add('<?xml version="1.0"
standalone="yes"?>');
Add('<DFW>');
Add('<savenight>');
[red]Add('<name>savenight</name>');[/red]
Add('<sex>man</sex>');
Add('</savenight>');
Add('</DFW>');
end;
XMLDocument1.Active := true;
XMLDocument1.SaveToFile('d:/tmp/test.xml');
英文都能顺利通过,如果将[red]Add('<name>savenight</name>');[/red]改成
[red]Add('<name>中文</name>');[/red]
程序就会报错,请各位兄弟帮帮忙,在线等待!!
procedure TForm1.Button1Click(Sender: TObject);
var
aNode, aValueNode: IXMLNode;
wStr: widestring;
begin
//+++++++++++++++++++++++++++++++++++++
//用TXmlDocument实现创建一个Xml文档
with XMLDocument1.XMLdo
begin
Add('<?xml version="1.0"
standalone="yes"?>');
Add('<DFW>');
Add('<savenight>');
[red]Add('<name>savenight</name>');[/red]
Add('<sex>man</sex>');
Add('</savenight>');
Add('</DFW>');
end;
XMLDocument1.Active := true;
XMLDocument1.SaveToFile('d:/tmp/test.xml');
英文都能顺利通过,如果将[red]Add('<name>savenight</name>');[/red]改成
[red]Add('<name>中文</name>');[/red]
程序就会报错,请各位兄弟帮帮忙,在线等待!!