Delphi comes with the TXMLDocument component which I have used extensively
lately with execellent result.
It's fast and there to be used!
XML :
<Player Position="Goalkeeper">
<PersonName>
<First>Edwin</First>
<Last>Van der Sar</Last>
</PersonName>
</Player>
Code :
var nMain,nPlayer,nPers : IXMLNode;
//.... Other vars
begin
//.... Pre processing
nMain := XMLDoc.DocumentElement.ChildNodes.FindNode('Players');
for I := 0 to nMain.ChildNodes.Count-1 do
begin // <Player Position="Substitute">
nPlayer := nMain.ChildNodes.Get(j);
if nPlayer.NodeName='Player' then
begin // <PersonName>
nPers := nPlayer.ChildNodes.FindNode('PersonName');
sPos := nPlayer.Attributes['Position']
nFirst:= nPers.ChildNodes.FindNode('First');
nLast := nPers.ChildNodes.FindNode('Last');
end;
//.... Do you thing
end;
Med vennlig hilsen/Best regards
Tor Kjell Holsethstuen
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Chris Stebbing
Sent: Wednesday, March 15, 2006 4:16 AM
To: Delphi List
Subject: XML Parser
Hi All,
I need a crash course in XML parsing, as well as some pointers to some
components which will help me do all the hard work.
My project is to download data from a webpage which provides XML data. I
then need to parse this code and extract certain bits of information. I
have Delphi 2005. I'd prefer freeware stuff or alternatively cheap
components.
I gather there's components out there that will turn the XML page into a
tree-like structure which will allow me to browse "nodes" and extract the
data.... That's about the limit of what I understand at the moment.
Any help and pointers you can provide would be most appreciated.
Cheers,
Chris.
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi