S
Shapper
Hello,
I have a XML file (RSS 2.0 format). Something as follows:
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>News</title>
<description>Latest News</description>
<item>
<title>Title</title>
<link>Url</link>
<description>Description</description>
<pubDate>Fri, 20 May 2005 12:30:00 GMT</pubDate>
</item>
...
I need to do the following:
1. Load the 10 most recent items (using pubDate as reference).
2. Place the loaded items in a dataset.
3. pubDate must be a valid ASP.Net date/time format.
I think the standard XML pubDate format is not:
Fri, 20 May 2005 12:30:00 GMT
Well, at least I am getting a string in my dataset [pubDate] field.
I am having huge problems with (1) and (3).
Here is my code:
Dim news As New XmlDocument()
news.Load("http://www.domain.com/news.rss")
Dim x As Integer
Dim xNodeList As XmlNodeList =
news.SelectNodes("/rss[@version='2.0']/channel/item")
Dim dsNews As DataSet = New DataSet()
Dim xReader As XmlTextReader
For x = 0 To xNodeList.Count-1
xReader = New XmlTextReader(xNodeList.item(x).OuterXml,
XmlNodeType.Element, new XmlParserContext(Nothing, Nothing, Nothing,
XmlSpace.None))
dsNews.ReadXml(xReader, XmlReadMode.InferSchema)
Next x
Could someone help me with this?
It's making me crazy. I have been looking for the solution for past 2
days.
Thank You,
Miguel
I have a XML file (RSS 2.0 format). Something as follows:
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>News</title>
<description>Latest News</description>
<item>
<title>Title</title>
<link>Url</link>
<description>Description</description>
<pubDate>Fri, 20 May 2005 12:30:00 GMT</pubDate>
</item>
...
I need to do the following:
1. Load the 10 most recent items (using pubDate as reference).
2. Place the loaded items in a dataset.
3. pubDate must be a valid ASP.Net date/time format.
I think the standard XML pubDate format is not:
Fri, 20 May 2005 12:30:00 GMT
Well, at least I am getting a string in my dataset [pubDate] field.
I am having huge problems with (1) and (3).
Here is my code:
Dim news As New XmlDocument()
news.Load("http://www.domain.com/news.rss")
Dim x As Integer
Dim xNodeList As XmlNodeList =
news.SelectNodes("/rss[@version='2.0']/channel/item")
Dim dsNews As DataSet = New DataSet()
Dim xReader As XmlTextReader
For x = 0 To xNodeList.Count-1
xReader = New XmlTextReader(xNodeList.item(x).OuterXml,
XmlNodeType.Element, new XmlParserContext(Nothing, Nothing, Nothing,
XmlSpace.None))
dsNews.ReadXml(xReader, XmlReadMode.InferSchema)
Next x
Could someone help me with this?
It's making me crazy. I have been looking for the solution for past 2
days.
Thank You,
Miguel