Autor Beitrag
NetSpider
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 123

Windows XP Pro
Delphi 7 Enterprise
BeitragVerfasst: Do 11.12.08 17:56 
Hi,

Ich habe ein Problem mit dem MSXML Parser. Habe eine TXMLDocument und einen Button auf dem Formular. Der Quelltext:

ausblenden 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 user profile iconNarses: Topic aus Internet / Netzwerk verschoben am Do 11.12.2008 um 17:58

_________________
Wer in die Fußstapfen anderer tritt hinterlässt keine eigenen Spuren!