unit xml_main_frm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, MSXML5_TLB, StdCtrls, OleServer;
type
TForm1 =
class(TForm)
Button1: TButton;
ListBox1: TListBox;
XMLDoc: TMSDOMDocument50;
procedure Button1Click(Sender: TObject);
procedure XMLDocondataavailable(Sender: TObject);
private
{ Private-Deklarationen }
procedure LoadXML_List(
const Source :
String);
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
ListBox1.Clear;
LoadXML_List('
http://www.delphipraxis.com/rdf.php');
end;
procedure TForm1.LoadXML_List(
const Source:
String);
begin
XMLDoc.DefaultInterface.load(Source);
end;
procedure TForm1.XMLDocondataavailable(Sender: TObject);
var
xmlTopics : IXMLDOMNodeList;
iCnt : Integer;
jCnt : Integer;
begin
If XMLDoc.DefaultInterface.parseerror.errorCode=0
then
begin
// XMLDoc.DefaultInterface.SetProperty('SelectionNamespaces','xmlns:na="http://my.netscape.com/rdf/simple/0.9/"');
xmlTopics := xmlDoc.DefaultInterface.documentElement.childNodes;
For iCnt := 0
to xmlTopics.length-1
do
begin
For jCnt:=0
to xmlTopics.item[iCnt].childNodes.length-1
do
ListBox1.Items.Add(xmlTopics.item[iCnt].childNodes.item[jCnt].Text+'
: '+
xmlTopics.item[iCnt].childNodes.item[jCnt].nodeName);
ListBox1.Items.Add('
----');
end;
end
else
ShowMessage('
Fehler beim parsen');
end;
end.