Hallo,
ich komme einfach mit dem XMLReader nicht zurecht. Ich verstehe trotz Doku nicht wie er funktionieren soll. Ich habe mal folgenden Code:
Das was ich eigentlich will, ist von dem RssFeed einfach alle Inhalte des XML Files , die im Node "Item" stehen, auslesen. Der Node item schaut so aus:
Also, ich möchte sagen wir mal zwei Varaiblen deklarieren namens "Inhalt" und "Zeit", und "Inhalt" soll eben der "Description"-Tag zugewiesen werden und "Zeit" halt der Tag "PubDate". Das muss doch ganz einfach gehen?
ich komme einfach mit dem XMLReader nicht zurecht. Ich verstehe trotz Doku nicht wie er funktionieren soll. Ich habe mal folgenden Code:
Code:
Try
request = System.Net.WebRequest.Create(RssFeed)
IoStream = request.GetResponse.GetResponseStream
sd = New XmlTextReader(IoStream)
sd.Read()
help = sd.Value
help = sd.ReadOuterXml
Do
sd.MoveToContent()
sd.MoveToFirstAttribute()
help = sd.Value
help = sd.ReadOuterXml
help = sd.Item("item")
Loop
help = sd.ReadInnerXml
help = sd.ReadOuterXml
help = sd.Item("item")
IoStream.Close()
sw2.Close()
Catch ex As SystemException
text = ""
End Try
Das was ich eigentlich will, ist von dem RssFeed einfach alle Inhalte des XML Files , die im Node "Item" stehen, auslesen. Der Node item schaut so aus:
Code:
- <item>
<title>Biotage AB Acquires Separtis Holding AG for 1.4M Euros (13M SEK) and Completes EU Distribution Consolidation</title>
<link>http://www.primezone.com/newsroom/news.html?ref=rss&d=87415</link>
<description>STOCKHOLM, Sweden, Oct. 6, 2005 (PRIMEZONE) -- Biotage has acquired Separtis Holding AG, the Swiss, German and Austrian distributor for many Biotage products, formerly the Argonaut Technologies consumable product range. Under the terms of the agreement, Biotage will retain all current Separtis employees, assume the leased facilities in Grenzach-Wyhlen, and own all assets of Separtis, which is based in Grellingen, Switzerland with operating legal entities within Switzerland and Germany. The turnover of the company in 2004 was 1.6M (14.6M SEK) Euros and all revenues were comprised of Biotage-produced products. It is expected the acquisition should result in an annual revenue increase of 7.5M SEK.</description>
<guid isPermaLink="true">http://www.primezone.com/newsroom/news.html?ref=rss&d=87415</guid>
<pubDate>Thu, 6 Oct 2005 07:09 GMT</pubDate>
</item>
Also, ich möchte sagen wir mal zwei Varaiblen deklarieren namens "Inhalt" und "Zeit", und "Inhalt" soll eben der "Description"-Tag zugewiesen werden und "Zeit" halt der Tag "PubDate". Das muss doch ganz einfach gehen?