09-03-2011، 10:41 AM
من تو دلفی 2010 مینیویسم
اینم یه sample
اینم یه sample
کد:
var
sl : TStringList;
xmlDoc : TXMLDocument;
iNode : IXMLNode;
begin
xmlDoc := TXMLDocument.Create(nil) ;
try
xmlDoc.Active := true;
iNode := xmlDoc.AddChild('leaf') ;
iNode.Attributes['attrib1'] := 'value1';
iNode.Text := 'Node Text';
sl := TStringList.Create;
try
sl.Assign(xmlDoc.XML) ;
sl.Insert(0,'<!DOCTYPE ns:mys SYSTEM "myXML.dtd">') ;
sl.Insert(0,'<?xml version="1.0"?>') ;
sl.SaveToFile('c:\Test.xml') ;
finally
sl.Free;
end;
finally
xmlDoc := nil;
end;
end;
And here's the resulting XML: <?xml version="1.0"?>
<!DOCTYPE ns:mys SYSTEM "myXML.dtd">
<leaf attrib1="value1">Node Text</leaf>
گروه دور همی پارسی کدرز
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg
https://t.me/joinchat/GxVRww3ykLynHFsdCvb7eg