求一个最快的读取XML算法,现在读取一个有五万个Node的XML要差不多五分钟!
现在的代码:
uses
XMLIntf, XMLDoc
XMLDocument :IXMLDocument;
XMLNode, XMLNode2:IXMLNode; XMLDocument := XMLDoc.TXMLDocument.Create( 'E:\test.xml' );
XMLDocument.Active := True;
XMLNode := XMLDocument.DocumentElement;
for i:=0 to XMLNode.ChildNodes.Count-1 do
begin
XMLNode2:=XMLNode.ChildNodes.Get(i);
for j := 0 to XMLNode2.AttributeNodes.Count-1 do
begin
....
end;
end;
XMLDocument.Active:=False;
XMLNode2:=Nil;
XMLNode:=Nil;
XMLDocument:=Nil;