Robb Hill
asked on
Convert RSS Feed URL into an XML File
I have a url of an RSS Feed and would like to get it on my computer in the format of an XML file. How do you go about doing this?
Thanks
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
just open the file in web browser and click File > Save As in the IE or whatever browser you use...
ASKER
Private Sub GetWNBC_SportsData(ByVal stateInfo As Object)
'Variables for working with exisitng RSS feed's XML data
Dim xmldoc As New Xml.XmlDocument
Dim xmlnlist As Xml.XmlNodeList
Dim xmln As Xml.XmlNode
Dim config As System.Configuration.Confi gurationSe ttings
'------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -----
'The following variables are used for creating the new xml file
Dim xmlRevDoc As New Xml.XmlDocument
' Create the root element
Dim rootNode As XmlElement = xmlRevDoc.CreateElement("W NBC_Sports ")
xmlRevDoc.AppendChild(root Node)
'------------------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -----
Try
xmldoc.Load(config.AppSett ings("Data Sports"))
xmlnlist = xmldoc.SelectNodes("//item /descripti on")
Dim category As String = "WNBC_Sports"
For Each xmln In xmlnlist
'Get node information used for new xml file
Dim description As String = xmln.InnerText
' Create the required nodes
Dim mainNode As XmlElement = xmlRevDoc.CreateElement("D escription ")
'retrieve the text
Dim txtDescription As XmlText = xmlRevDoc.CreateTextNode(d escription )
'append the nodes to the parent node without the value
rootNode.AppendChild(mainN ode)
' save the value of the field into the node
mainNode.AppendChild(txtDe scription)
Next
WriteXML(category, xmlRevDoc.OuterXml.ToStrin g)
'xmlRevDoc.Save("WNBC_Spor ts_Descrip tion.xml")
Catch ex As Exception
cErr.ReportError(ex)
End Try
End Sub
'Variables for working with exisitng RSS feed's XML data
Dim xmldoc As New Xml.XmlDocument
Dim xmlnlist As Xml.XmlNodeList
Dim xmln As Xml.XmlNode
Dim config As System.Configuration.Confi
'-------------------------
'The following variables are used for creating the new xml file
Dim xmlRevDoc As New Xml.XmlDocument
' Create the root element
Dim rootNode As XmlElement = xmlRevDoc.CreateElement("W
xmlRevDoc.AppendChild(root
'-------------------------
Try
xmldoc.Load(config.AppSett
xmlnlist = xmldoc.SelectNodes("//item
Dim category As String = "WNBC_Sports"
For Each xmln In xmlnlist
'Get node information used for new xml file
Dim description As String = xmln.InnerText
' Create the required nodes
Dim mainNode As XmlElement = xmlRevDoc.CreateElement("D
'retrieve the text
Dim txtDescription As XmlText = xmlRevDoc.CreateTextNode(d
'append the nodes to the parent node without the value
rootNode.AppendChild(mainN
' save the value of the field into the node
mainNode.AppendChild(txtDe
Next
WriteXML(category, xmlRevDoc.OuterXml.ToStrin
'xmlRevDoc.Save("WNBC_Spor
Catch ex As Exception
cErr.ReportError(ex)
End Try
End Sub