Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    leggere rss problema <![CDATA

    Ciao a tutti
    Ho bisogno di leggere delle notizie in un rss

    Il problema e che Lo script non riesci a leggere la Description che è dentro delle targhe <![CDATA
    e non trovo nessuna soluzione
    qui è lo script che uso per leggere le notizie
    <%
    ' Script ASP Para leitura de arquivos de RSS.
    url = "http://clientes.climatempo.com.br/RSS/capitais.xml" 'Aqui vai o endereço do arquivo RSS, ou do arquivo "gerador"

    ' Criando Objeto XML
    Set objXML = Server.CreateObject("msxml2.DOMDocument.3.0")
    objXML.async = false
    objXML.setProperty "ServerHTTPRequest", True

    ' Não validar o arquivo
    objXML.validateOnParse =false' true

    ' Retirar espaços
    objXML.preserveWhiteSpace = false

    blnLoaded = objXML.Load(url)
    If Not blnLoaded Then
    Response.write "Nenhum notícia na fonte!"
    Else
    set objNodeList = objXML.getElementsByTagName("channel")

    For Each objNode In objNodeList
    For Each objNode2 In objNode.childNodes

    Select Case objNode2.nodeName
    Case "title"
    html = html &"<tr><td>"
    html = html &objNode2.firstChild.nodevalue
    html = html &"
    </td></tr>"
    Case "link"
    html = html &"<tr><td><a target=_blank href="& objNode2.firstChild.nodevalue &">"
    html = html & objNode2.firstChild.nodevalue
    html = html &"</a></td></tr>"
    Case "description" 'Está desabilitado para exibir apenas os links
    html = html &"<tr><td>"
    html = html & objNode2.firstChild.nodevalue
    html = html &"
    </td></tr>"
    End Select
    Next
    Next

    html = html &"<tr><td><hr></td></tr>"

    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

    html = html &"<tr><td><li/>"& strTitle &"
    "& strDescription &"</td></tr>"
    strTitle = ""
    strURL = ""
    strDescription = ""
    Next

    html = "<table>"& html &"</table>"
    set objNodeList = Nothing
    End if
    %>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    </head>

    <body>
    <%
    Response.write (html)
    %>
    </body>
    </html>
    esiste una soluzione per questo?
    ho cercato su tutta internet ma non lo trovo

    Grazie a tutti
    Grazie

  2. #2
    <![CDATA[dato da mettere]]>
    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  3. #3
    Ciao Santino83_02
    Non ho capito che volevi dire!
    che vuoi dire dato da mettere?

  4. #4
    apparte che non ho capito dov'è che usi il cdata in quel codice, dicevo che al posto di "dato da mettere" devi mettere il tuo testo che vuoi che stia dentro al CDATA, ovvero quello da codificare (in xml) come "dato" e non , nel caso, erroneamente come elemento xml o altro.


    IP-PBX management: http://www.easypbx.it

    Old account: 2126 messages
    Oldest account: 3559 messages

  5. #5
    Non hai capitooo!!
    il file che ha il <![cdata] e nella pagina di notizie in rss
    quello che ho messo qui è il codice per leggere il file rss di quello sito
    http://clientes.climatempo.com.br/RSS/capitais.xml

    il problema è che nel codice del file rss c'è scritto per esempio:
    <description>
    - <![CDATA[ (Quarta - 07/11) - Uma grande massa de ar quente e úmido ainda predomina sobre o Norte do País. O sol aparece e faz calor, mas durante a tarde ocorrem pancadas de chuva e trovoadas. O tempo segue mais carregado no Amazonas, no Acre e em Rondônia.

    ]]>
    </description>
    vuoglio dire..
    lo script che ho messo qui non riesce leggere quello che è scritto dentro della tag CDATA

    questo è mio problema.
    ----------------------------



    Adesso ho provato lo script XML RSS Content Feed
    http://www.tele-pro.co.uk/scripts/rs...feed_class.htm



    me viene questo errore quando metto su internet:
    Microsoft VBScript runtime error '800a0046'

    Permission denied

    /rss_code/rss_content_feed_class.1.asp, line 803
    forse perche è su serve aruba


    AIUTO!!
    sono 4 notte che sbatto su internet

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 © 2026 vBulletin Solutions, Inc. All rights reserved.