开发者

Parsing XML in Delphi Access violation [closed]

开发者 https://www.devze.com 2023-02-15 19:10 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_如何学Go Closed 11 years ago.

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;
0

精彩评论

暂无评论...
验证码 换一张
取 消