var
XMLDOM : IXMLDOMDocument;
NodeList : IXMLDOMNodeList;
i : Integer;
begin
XMLDOM := CoDomDocument.Create;
try
//XMLDOM.loadXML(cstr);
XMLDOM.load('d:\test.xml');
NodeList := XMLDOM.selectNodes('/ExecuteList/Execute[@name="Result"]');
for i := 0 to NodeList.length - 1 do
// Memo1.Lines.Add((NodeList.item[i].attributes.item[0].nodevalue);
// Memo1.Lines.Add('Description = ' + (NodeList.item[i] as IXMLDomElement).attributes.get .attributes.getNamedItem('Description').nodeValue );
Memo1.Lines.Add((NodeList.item[i] as IXMLDomElement).text);
finally
NodeList := nil;
XMLDOM := nil;
end;
test.xml
-----------------------------------------------------------------------------
<?xml version="1.0" encoding="euc-kr"?>
<ExecuteList>
<Execute name="Result" description="Connection Execute Result">OK</Execute>
<Execute name="ExecuteCnt" description="Connection Execute Result Count">3</Execute>
</ExecuteList>