Quote:
quote:Originally posted by joefawcett
Can you point to the RSS link? These problems are normally caused by encoding incorrectly declared or the process changing it at some stage. Can you show some of your code?
Joe (MVP - xml)
|
The url for the rss is
http://news.bbc.co.uk/rss/newsonline...lth/rss091.xml
My code is
<code>
url = request.querystring("url")
call getXmlNews(url)
Sub getXmlNews(address)
Set oXMLHttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
dim URL
dim i
dim j
dim root
URL= address
oXMLHttp.open "GET", URL, false
oXMLHttp.send() ' Send the request.'
If oXMLHttp.status = 200 Then
sXML = oXMLHttp.responseText ' Retrieve from serverB.'
removeDoctype(sXML)
set oXML = Server.CreateObject("MSXML2.DomDocument")
'response.write(sXML)'
oXML.loadXML(sXML)
'*** create Title info'
newstitle = oXML.getElementsByTagName("title").item(0).text
response.write("<div id=""maintitle"">"&newstitle&"</div>")
response.write("")
'*** Write news items'
Set objLst = oXML.getElementsByTagName("item")
intNoOfHeadlines = objLst.length -1
'response.write(intNoOfHeadlines)'
strContent = ""
For i = 0 To (intNoOfHeadlines)
strContent = strContent &"<div class=""main"">"
Set objHdl = objLst.item(i) 'loop through each item'
for j = 0 to objHdl.childNodes.length -1
If objHdl.childNodes(j).nodeName = "title" Then
strContent = strContent &"<div id=""title"">"&objHdl.childNodes(j).text&"</div>"
End If
If objHdl.childNodes(j).nodeName = "description" Then
strContent = strContent &"<div id=""description"">"&objHdl.childNodes(j).text&"</div>"
End If
If objHdl.childNodes(j).nodeName = "link" Then
strContent = strContent &"<div id=""link""><a href="""&objHdl.childNodes(j).text&" "" target=""blank"">View Item</a></div>"
End If
If objHdl.childNodes(j).nodeName = "pubDate" Or objHdl.childNodes(j).nodeName = "dc:date" Then
strContent = strContent &"<div id=""pubdate"">Document Published: "&objHdl.childNodes(j).text&"</div>"
End If
Next
strContent = strContent &"</div>"
Next
strContent = strContent &"<br /><br />" 'make alittle space at bottom of page'
Else
strContent = "Sorry...the news source is temporarily unavailable - Please try again later. " '&oXMLHttp.status'
End if
Response.Write(strContent) 'Write out the content'
set oXML = Nothing
set oXMLHttp = Nothing
End Sub
</code>
Thanks for your quick response
phil