S
s_m_b
Using w2k advanced server (test system is standard server)
"Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load
("http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml")
If objXML.parseError.errorCode <> 0 Then
'Response.Write "<pre>" & vbCrLf
Response.Write ("<strong>Error:</strong> " &
objXML.parseError.reason )
Select Case objXML.parseError.errorCode
Case 0
strResult = "Valid: " & strFileName & vbCr
Case Else
strResult = vbCrLf & "ERROR! Failed to validate " &
vbCrLf & objXML.parseError.reason & vbCr & "Error code: " &
objXML.parseError.errorCode & ", Line: " & objXML.parseError.line & ",
Character: " & objXML.parseError.linepos & ", Source: " & Chr(34) &
objXML.parseError.srcText & Chr(34) & " - " & Now & vbCrLf
End Select
Response.Write ("<strong>Line:</strong> " & objXML.parseError.line
& vbCrLf)
Response.Write ("<strong>Text:</strong> " & strResult)
Server.HTMLEncode(objXML.parseError.srcText) & vbCrLf
'Response.Write "</pre>" & vbCrLf
End If
Set objItemList = objXML.getElementsByTagName("item")
Set objXML = Nothing
intcount = 0
For Each objItem In objItemList
intcount = intcount+1
' childNodes: 0=title, 2=link, 1=description
Response.Write ("<p>» " & vbLf)
Response.Write ("<a href=""" & objItem.childNodes(2).text & """
target = ""bbcnews"">" & vbLf)
Response.Write (objItem.childNodes(0).text & "</a><br />
" & vbLf)
response.write ("<span style=""font-style:italic"">" &
objItem.childNodes(1).text & "</span>" & vbLf)
Response.Write ("</p>" & vbCrLf)
if intcount > 1 then exit for
Next"
Is there any way to get the raw feed from the XML, no matter what the
error comes back as. I'm currently getting 'invalid response' with an
error code of :-2147012744, which I can't find, but understand to be a
nonespecific HTTP error.
"Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load
("http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml")
If objXML.parseError.errorCode <> 0 Then
'Response.Write "<pre>" & vbCrLf
Response.Write ("<strong>Error:</strong> " &
objXML.parseError.reason )
Select Case objXML.parseError.errorCode
Case 0
strResult = "Valid: " & strFileName & vbCr
Case Else
strResult = vbCrLf & "ERROR! Failed to validate " &
vbCrLf & objXML.parseError.reason & vbCr & "Error code: " &
objXML.parseError.errorCode & ", Line: " & objXML.parseError.line & ",
Character: " & objXML.parseError.linepos & ", Source: " & Chr(34) &
objXML.parseError.srcText & Chr(34) & " - " & Now & vbCrLf
End Select
Response.Write ("<strong>Line:</strong> " & objXML.parseError.line
& vbCrLf)
Response.Write ("<strong>Text:</strong> " & strResult)
Server.HTMLEncode(objXML.parseError.srcText) & vbCrLf
'Response.Write "</pre>" & vbCrLf
End If
Set objItemList = objXML.getElementsByTagName("item")
Set objXML = Nothing
intcount = 0
For Each objItem In objItemList
intcount = intcount+1
' childNodes: 0=title, 2=link, 1=description
Response.Write ("<p>» " & vbLf)
Response.Write ("<a href=""" & objItem.childNodes(2).text & """
target = ""bbcnews"">" & vbLf)
Response.Write (objItem.childNodes(0).text & "</a><br />
" & vbLf)
response.write ("<span style=""font-style:italic"">" &
objItem.childNodes(1).text & "</span>" & vbLf)
Response.Write ("</p>" & vbCrLf)
if intcount > 1 then exit for
Next"
Is there any way to get the raw feed from the XML, no matter what the
error comes back as. I'm currently getting 'invalid response' with an
error code of :-2147012744, which I can't find, but understand to be a
nonespecific HTTP error.