604
社区成员
发帖
与我相关
我的任务
分享
void __fastcall TForm1::FormCreate(TObject *Sender)
{
TNativeXml *ADoc;
TXmlNode *node;
ADoc = new TNativeXml("Root");
try
{
node = ADoc->Root->NodeNew("Customer");
node->WriteAttributeInteger("ID", 123456);
node->WriteString("Name", "John Doe");
ADoc->XmlFormat = xfReadable;
ADoc->SaveToFile("c:\\test.xml");
}
__finally
{
ADoc->Free();
}
}