Parsing XML in Delphi Access violation [closed]
Guys, I really need help. I need to parse a XML string in Delphi 7, but I keep on getting access violations...Please help!!! Any bit of code.....
A bit of code.
var
doc: IXMLDocument;
Root, Val: IXMLNode;
I: Integer;
begin
//doc := LoadXMLDocument('XMLFile.xml');
doc := LoadXMLData('<?xml version="1.0" encoding="UTF-8"?>'+
'<Root>'+
'<Val>1</Val>'+
'<Val>2</Val>'+
'</Root>');
Root := doc.ChildNodes.FindNode('Root');
for I := 0 to Root.ChildNodes.Count - 1 do
begin
Val := Root.ChildNodes[I];
ShowMessage(Val.NodeName+'='+ Val.NodeValue);
end;
end;
精彩评论