Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786

    paginazione dati presi da xml

    Salve,

    ho questo scritp, che visualizza delle news prese da un file xml, ora voglio paginare i risultati in modo da avere 5 risultati per pagina.

    quale modifiche si devono fare per far ciò ?

    me le potete fare voi le modifiche per favore ?

    Grazie mille

    codice:
    <%
       url = "http://www.miosito.it/rss/news.xml"
       ' Creo oggetto DOM 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 
          Response.write "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 "link" 
             strURL = objNode2.firstChild.nodevalue 
          Case "description" 
             strDescription = objNode2.firstChild.nodevalue 
          End Select 
    		 Next 
       
       Stampa = strTitle & " " & strURL & " "
    
    
          Next  
          
    	  set objNodeList = Nothing 
       End if 
    %>
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  2. #2
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    up
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  3. #3
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    For Each objNode In objNodeList

    Limita i nodi da prelevare... hai da lavorarci un bel po'.

    Roby

  4. #4
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    Mi dai per favore qualche info in + ?

    per caso mi puoi dare un esempio di For Each objNode In objNodeList che limita i nodi da prelevare, ad esempio dal nodo 1 al 5 ?

    Grazie !
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  5. #5
    Utente di HTML.it
    Registrato dal
    Dec 2002
    Messaggi
    1,786
    Originariamente inviato da unreg
    Mi dai per favore qualche info in + ?

    per caso mi puoi dare un esempio di For Each objNode In objNodeList che limita i nodi da prelevare, ad esempio dal nodo 1 al 5 ?

    Grazie !
    questo lo risolto

    mi è bastato mettere questo:

    codice:
    	     i = i + 1 
             if i = 6 then Exit For
    dopo questo:

    codice:
          For Each objNode In objNodeList

    ma se io voglio prelevare i nodi dall' 6 al 10 come devo fare ?
    [Scambio Links a Tema] Contattatemi in Privato x + Info.

  6. #6
    Moderatore di ASP e MS Server L'avatar di Roby_72
    Registrato dal
    Aug 2001
    Messaggi
    19,559
    codice:
    if i < 6 or i > 10 then Exit For
    Non è detto che così funzioni...

    Roby

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.