XMLTemp:=TXMLDocument. Create (nil);
XMLTemp. XML. The Clear;
XMLTemp. LoadFromFile (dataPath);
XMLTemp. Active:=True;
ShowMessage (XMLTemp. XML. Text);
If (XMLTemp. DOMDocument=nil) then the begin
ShowMessage (' a ');
exit;
end;
If (XMLTemp. DocumentElement..childnodes=nil) then//it an error?
The begin
end;
ShowMessage (XMLTemp DocumentElement. Text);
//ShowMessage (XMLTemp DocumentElement..childnodes.);
If (XMLTemp. DocumentElement. NodeName='GOODS') then
The begin
XMLNodeTemp:=XMLTemp DocumentElement..childnodes. First;
Error message is the Access violation at address 4 b2e726f. Write of address 4 b2e726f
Please expert guidance
CodePudding user response:
I try,,Why
Name:=XMLTemp. DocumentElement. NodeName.
Name:=XMLTemp. DOMDocument. DocumentElement. NodeName.
The first error, the second ok???????
CodePudding user response:
Check the XML file, if there is a child node DocumentElement,CodePudding user response: