Hello,
I want to create rss feeds through vb.net.
The xml code of a valid rss is as shown:
<rss version="2.0">
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
>
<channel>
<title>indiavideo2173451</title>
<atom:link href="http://hostmyrss.com/feed/indiavideo2173451" rel="self" type="application/rss+xml" xmlns:atom="#unknown" />
<link>http:
<description></description>
<item>
<title>How to key - Howtounlock - Zimbio</title>
<link>http:
<pubdate>Sun, 4 Jul 2010 02:40:23 -0700</pubdate>
<guid ispermalink="true">http:
<description>What are software keys or unlock keys ? Software keys are a type of security method implemented to prevent piracy or illegal sharing of the software. Companies spend thousands of dollars to make a software. To prevent it from being pirated</description>
</item>
</channel>
</rss>
I use the following code in vb.net :
Dim xtw As New XmlTextWriter(SaveFileDialog1.FileName, Encoding.UTF8)
xtw.WriteStartDocument()
xtw.WriteComment("")
xtw.WriteStartElement("rss")
xtw.WriteAttributeString("version", "2.0")
xtw.WriteStartElement("channel")
xtw.WriteElementString("title", TextEdit1.Text)
xtw.WriteElementString("link", TextEdit2.Text)
xtw.WriteElementString("atom:link", "")
xtw.WriteElementString("description", TextEdit3.Text)
Dim i As Integer
For i = 0 To RichTextBox1.Lines.Count - 1
html = http.QuickGetStr(RichTextBox1.Lines(i))
xtw.WriteStartElement("item")
xtw.WriteElementString("title", htmlUtil.GetTitle(html))
xtw.WriteElementString("description", htmlUtil.GetDescription(html))
xtw.WriteElementString("link", RichTextBox1.Lines(i))
xtw.WriteElementString("pubDate", Now.Date.ToString)
xtw.WriteElementString("guid", RichTextBox1.Lines(i))
xtw.WriteEndElement()
Next
xtw.WriteEndElement()
xtw.WriteEndElement()
xtw.WriteEndDocument()
xtw.Flush()
xtw.Close()
I am not able to get the valid xml output.
On using this with w3c rss validator I get 2 errors:
1.) I need this line : <atom:link href="http://hostmyrss.com/feed/indiavideo2173451" rel="self" type="application/rss+xml" xmlns:atom="#unknown">
how do I add that?
for more errors see : http://validator.w3.org/feed/check.cgi?url=http%3A%2F%2Fballiya007.fileave.com%2Ffirst.xml
I have removed other errors.