Mega Code Archive

 
Categories / Delphi / ADO Database
 

Rss okuyucu [xml]

Çalışan denenmiş bir rss okuyucu örneği RSS - portal ve gazeteler arasında bilgi aktarımını standart haline getirmek için kullanılan XML yapısı. İlk çıkaran NESTCAPE (0.91) ücretli olduğu için open source olarak başkaları çıkarıyor. sonra NETSCAPE beleş hale getiriyor şu anda 2.0 versionu var birde önüne gelen çıkarmış... değişik versionlar var. gönderdiğim kod 2.0 be 0.91 de denenmiştir. aslında genel yapı aynıdır teoride kodun hepsini açması gerekiyor... Fakat Radikal Gazetesi http://www.radikal.com.tr/radikal.xml adresinde RSS - XML (0.91) e kendisi kafadan <sayfa_2><sayfa_3> gibi taglar eklemiş aşağıdaki kod onu görünce çıldırıyor tabiiii :) Birisi o kunuyuda araştırıp kodu düzeltirse sevinirim tabi Genel RSS yapısı -------------------------------------------------------- <rss version="0.91"> <channel> <title>XML.com</title> <link>http://www.xml.com/</link> <description>XML.com features a rich mix of information and services for the XML community.</description> <language>en-us</language> <item> <title>Normalizing XML, Part 2</title> <link>http://www.xml.com/pub/a/2002/12/04/normalizing.html</link> <description>In this second and final look at applying relational normalization techniques to W3C XML Schema data modeling, Will Provost discusses when not to normalize, the scope of uniqueness and the fourth and fifth normal forms.</description> </item> <item> <title>The .NET Schema Object Model</title> <link>http://www.xml.com/pub/a/2002/12/04/som.html</link> <description>Priya Lakshminarayanan describes in detail the use of the .NET Schema Object Model for programmatic manipulation of W3C XML Schemas.</description> </item> <item> <title>SVG's Past and Promising Future</title> <link>http://www.xml.com/pub/a/2002/12/04/svg.html</link> <description>In this month's SVG column, Antoine Quint looks back at SVG's journey through 2002 and looks forward to 2003.</description> </item> </channel> </rss> -------------------------------------------------------------------------- PARSER KODU var StartItemNode : IXMLNode; ANode : IXMLNode; STitle, sDesc, sLink : WideString; begin ... //points to local XML file in "original" code XMLDoc.FileName := 'http://z.about.com/6/g/delphi/b/index.xml'; XMLDoc.Active:=True; StartItemNode := XMLDoc.DocumentElement.ChildNodes. First.ChildNodes.FindNode('item'); ANode := StartItemNode; repeat STitle := ANode.ChildNodes['title'].Text; sLink := ANode.ChildNodes['link'].Text; sDesc := ANode.ChildNodes['description'].Text; //add to list view with LV.Items.Add do begin Caption := STitle; SubItems.Add(sLink); SubItems.Add(sDesc) end; ANode := ANode.NextSibling; until ANode = nil;