Quantcast
Channel: Fórum ASP
Viewing all articles
Browse latest Browse all 1214

Leitura de RSS

$
0
0

OLÁ, alguém utiliza essa função de leitura de RSS:

 

Function fnRSSReader(RSSFile, XSLFile)
	'Original Author:Rafay Bin Ali
	'Original Author Email: rafayali@gmail.com
	'Original Author Blog: http://rafayali.blogspot.com
	'Original Author Website: http://cc.1asphost.com/powerwebdev/index.htm
	'Adaptation by: Ronaldo Storck - http://www.tenq.com.br
	'Monitorado por: Tenq! - Gestão para WEB
	if RSSFile <> "" AND XSLFile <> "" then
	set objXML=server.createObject("MSXML2.DOMDocument.6.0")
	objXML.async=false
	objXML.load(RSSFile)
	if objXML.parseError.errorCode <> 0 then
		response.write "No momento a fonte de dados das notícias está fora do ar. -> "
		 Response.Write(objXML.parseError.reason)
   		 Response.Write(objXML.parseError.errorCode)
	end if
	set objXSL=server.createObject("MSXML2.DOMDocument.6.0")
	objXSL.async=false
	objXSL.load(XSLFile)
	if objXSL.parseError.errorCode <> 0 then
	response.write "O arquivo de layout .xsl não foi encontrado"
	end if
	response.write(objXML.transformNode(objXSL))
	else
	response.write("Deve ser usada a sintaxe correa para acessar o canal RSS")
	end if
End Function 

Chamando:

RSSFile = "http://g1.globo.com/dynamo/brasil/rss2.xml"
   	XSLFile = Server.MapPath("noticias.xsl")
   	Response.Write(fnRSSReader(RSSFile, XSLFile))

Funcionava bem o o DOMDocument 3, agora que passei para um servidor com a versão 6, está dando o erro:

 

The download of the specified resource has failed. -2146697208 

Pode ser alguma coisa com a versão do xml?

 

obrigado...

 

 


Viewing all articles
Browse latest Browse all 1214

Trending Articles