Hi,
Ich habe ein Problem mit dem MSXML Parser. Habe eine TXMLDocument und einen Button auf dem Formular. Der Quelltext:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
| implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject); begin XMLDocument1.Active := false; XMLDocument1.XML.Clear;
XMLDocument1.XML.Text := '<?xml version="1.0" encoding="ISO-8859-1"?> <XMLmessage><Type xmlns="Server Information"/></XMLmessage>'; XMLDocument1.Active := true;
Caption := XMLDocument1.DOMDocument.getElementsByTagName('Type').item[0].namespaceURI end;
initialization CoInitializeEx(nil, COINIT_MULTITHREADED); finalization CoUninitialize;
end. |
Mit den beiden alternativen Parsern (Open XML und Xerces XML) funktioniert obiger Code. Mit dem MSXML Parser bekomme ich folgende Exception:
"First chance exception at $760EF35F. Exception class EAccessViolation with message 'Access violation at address 004C3471 in module 'Project1.exe'. Read of address 00000000'. Process Project1.exe (3212)"
und der Compiler zeigt auf die "Caption :=" Zeile. Was mache ich falsch? Und warum funktionieren die anderen Parser?
Moderiert von
Narses: Topic aus Internet / Netzwerk verschoben am Do 11.12.2008 um 17:58