Lendo xml previsão do tempo inpeP
Pessoal boa noite, venho aqui pois não consigo entender a estrutula de leitura do xml através do asp, bom o xml que preciso ler é esse http://servicos.cptec.inpe.br/XML/cidade/244/previsao.xml, bom o código que estou usando para tentar ler ele é
url = "http://servicos.cptec.inpe.br/XML/cidade/244/previsao.xml"
Set xml = Server.CreateObject("MSXML2.DOMDocument.3.0")
xml.async = False
xml.SetProperty "ServerHTTPRequest", True
xml.ValidateOnParse = False
xml.PreserveWhiteSpace = False
If Not xml.Load(url) Then
Response.Write "Nenhuma nticia disponivel no momento."
Else
Set nodeList = xml.getElementsByTagName("item")
For Each objNode In nodeList
For Each objNode2 In objNode.childNodes
Select Case objNode2.nodeName
Case "tempo" : title = objNode2.firstChild.nodevalue
Case "maxima" : description = objNode2.firstChild.nodevalue
End Select
Next
response.write("<radio arquivo="""&link&""" imgpeq=""logo_uol.png"" link="""" alvo=""principal"" tempo=""10"" titulo="""&title&"""><![CDATA["&description&"]]></radio>")
Next
Set nodeList = Nothing
End If
Set xml = Nothing
Realmente não consigo entender, se alguém puder ajudar a adpatar esse código para ler esse xml já ajuda bastante.
Agradeço desde já.
Discussão (1)
Carregando comentários...