Visualizzazione dei risultati da 1 a 5 su 5

Discussione: rss (errore)

  1. #1
    Utente di HTML.it L'avatar di agenti
    Registrato dal
    Feb 2002
    Messaggi
    2,427

    rss (errore)

    http://www.siciliatravel.com/2006/ultimenews.asp

    questo feed lo apro con:

    <%
    rssURL2 = "http://www.siciliatravel.com/2006/ultimenews.asp"

    'Creo l'oggetto DOM XML
    Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")

    'Imposto le proprietà dell'oggetto
    objXML.async = false
    objXML.setProperty "ServerHTTPRequest", True
    objXML.validateOnParse =false
    objXML.preserveWhiteSpace = false

    'Carico il file RSS dalla URL
    rssFile2 = objXML.Load(rssURL2)

    'Se ci sono errori stampo a video
    If Not rssFile2 Then
    Response.write "ERRORE..."

    'Se NON ci sono errori proseguo...
    Else

    'Recupero i dati dai nodi Item (e sotto nodi)
    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 "link"
    strURL = objNode2.firstChild.nodevalue
    End Select

    Next
    %>

    <ul>[*]
    "><%=mid(strTitle,22,35)%>...
    [/list]

    <%
    'azzero tutto per il prossimo passaggio
    strTitle = ""
    strURL = ""
    strDescription = ""

    Next

    set objNodeList = Nothing
    End if
    %>

    ma stranamente mi va in errore...
    :maLOL:

    mi chiedevo inoltre se fosse possibile ottenere solo un certo numero di righe, magari imponendo un For Each objNode In objNodeList limitato a "5".

  2. #2
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    Ti basta un contatore all'interno del ciclo.
    Quanto arrivi a 5 esci dalla for

    Roby

  3. #3
    Utente di HTML.it L'avatar di agenti
    Registrato dal
    Feb 2002
    Messaggi
    2,427
    si supponevo...

    ma perchè va in errore ...?
    altri rss vengono letti normalmente.

    Ciao.

  4. #4
    Utente di HTML.it L'avatar di agenti
    Registrato dal
    Feb 2002
    Messaggi
    2,427
    up...

  5. #5
    Utente di HTML.it L'avatar di agenti
    Registrato dal
    Feb 2002
    Messaggi
    2,427
    scusate ma up....

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.