Dazu habe ich ein Problem!
Das ist erstmal mein Code:
Delphi-Quellcode:
Procedure TForm1.cmd1Click( Sender: TObject );
Var XML: TXMLDocument;
Begin
XML :=
Nil;
{ odFile == TOpenDialog }
If odFile.Execute
Then Begin
Try
XML := TXMLDocument.Create(
Nil );
XML.LoadFromFile( odFile.FileName );
XML.Active;
{ txtOut == TMemo }
txtOut.Lines.Append( '
Version:'#9#9 +
XML.Version );
txtOut.Lines.Append( '
Encoding:'#9 +
XML.Encoding );
txtOut.Lines.Append( '
StandAlone:'#9 +
XML.StandAlone );
txtOut.Lines.Append( '
NamespaceURI:'#9 +
XML.DocumentElement.NamespaceURI );
txtOut.Lines.Append( '
LocalName:'#9 +
XML.DocumentElement.LocalName );
Finally
If Assigned(
XML )
Then FreeAndNil(
XML );
End;
End;
End;
Problem ist nun, das es beim setzen vom Active-Wert zu einer Zugriffsverletzung kommt, aber nicht immer, aber spätestens beim auslesen einer Eigenschaft...
Das Dokument was ich lade ist IO, wenn ich das TXMLDocument zur Entwicklungszeit auf die Form schieb und benutz funzt es ja...
Wo is der plöde Fehler?
Bye