Potete darmi una mano per il ciclo For .. to? mi da l'errore:
"Errore di run-time di Microsoft VBScript (0x800A01A8)
Necessario oggetto: 'OGGETTOA'"
il file xml è
Mentre il codice asp che uso è:codice:<?xml version="1.0" encoding="ISO-8859-1"?> <catalog> <categories> <category code="VT"><![CDATA[OGGETTOA]]></category> <category code="VTRT"><![CDATA[OGGETTOB]]></category> <category code="VFG"><![CDATA[OGGETTOT]]></category> <category code="VDF"><![CDATA[OGGETTO4]]></category> <category code="VSD"><![CDATA[OGGETTOE]]></category> ... ...
codice:StrURL = "http://www.miosito.com/xml/file.xml" Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP") objXMLHTTP.Open "GET", StrURL, false objXMLHTTP.Send content = objXMLHTTP.ResponseText set oXmlDoc = Server.CreateObject("MSXML2.DOMDocument") 'apri il file oXmlDoc.async = false oXmlDoc.loadXML (content) Dim category category=oXmlDoc.selectSingleNode("//categories/category").text response.write("Categoria=" & category & " ") ' Inizializzo il contatore per il ciclo i = 0 ' Estraggo tutti i dati For i = 0 To category.length - 1 With Response .Write "Nome: " & category(i).Text & " " End With Next

Rispondi quotando