Ciao,
Ho questo url rss che a volte fa funzioare il codice qui sotto e a volte no; dipende se nel file 20.xlm richiamato è presente la variabile description.
Quando non c'è mi da errore.
Come posso fare?
codice:<% url="http://www.welt.de/export/xml/rss-091/20.xml" Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0") objXML.async = false objXML.setProperty "ServerHTTPRequest", True ' validazione del documento XML objXML.validateOnParse =false' true ' non conservare spazi objXML.preserveWhiteSpace = false blnLoaded = objXML.Load(url) If Not blnLoaded Then html = "Nessuna news da visualizzare" Else Set objNodeList = objXML.getElementsByTagName("item") For Each objNode In objNodeList For Each objNode2 In objNode.childNodes Select Case objNode2.nodeName Case "title" strTitle = objNode2.firstChild.nodevalue Case "description" strDescription = objNode2.firstChild.nodevalue End Select Next html = html + strTitle + strDescription + " " strTitle = "" strDescription = "" Next set objNodeList = Nothing End if %> <%Response.write (html)%>

Rispondi quotando