uses
.., MSXML;
var
sXML: string;
sXML_FILE: string;
XMLDocument: IXMLDOMDocument;
begin
XMLDocument := CoDOMDocument.Create;
try
sXML := '<xml~>..</>'; //XML Format
XMLDocument.loadXML(sXML); //스트링으로 읽기
sXML_FILE := 'C:\Test.xml';
XMLDocument.load(sXML_FILE); //파일로 읽기
if XMLDocument.parseError.errorCode <> 0 then
ShowMessage(XMLDocument.parseError.reason);
{To Do}
finally
XMLDocument.Free;
end;
end;
반응형