Visualizzazione dei risultati da 1 a 7 su 7

Discussione: visualizzazione in xml

  1. #1
    Utente di HTML.it
    Registrato dal
    Jul 2003
    Messaggi
    583

    visualizzazione in xml

    "<?xml version=""1.0"" encoding=""UTF-8""?>"


    <%


    Dim OggFile, origine, OggTextStream
    origine=server.Mappath("/public/file.xml")
    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.CreateTextFile (origine)
    Set OggFile = fso.GetFile (origine)
    Set OggTextStream = OggFile.OpenAsTextStream(2)
    OggTextStream.WriteLine "<?xml version=""1.0"" encoding=""UTF-8""?>"
    OggTextStream.WriteLine "<fotos>"
    OggTextStream.WriteLine "<foto photo=''>Immagine 1</foto>"
    OggTextStream.WriteLine "<foto photo=''>Immagine 2</foto>"
    OggTextStream.WriteLine "<foto photo=''>Immagine 3</foto>"
    OggTextStream.WriteLine "<foto photo=''>Immagine 4</foto>"
    OggTextStream.WriteLine "</fotos>"
    OggTextStream.close


    response.write "Scrittura eseguita correttamente. Visualizza"
    %>

    ho provato questo sabato funzionava ora mi da questo

    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


    --------------------------------------------------------------------------------

    Numero di versione non valido. Errore durante l'elaborazione della risorsa "http://www.mediacasaitalia.it/casait/codice1.as...

    <?xml version=""1.0"" encoding=""UTF-8""?>
    ---------------^

  2. #2
    Utente di HTML.it
    Registrato dal
    Jul 2003
    Messaggi
    583
    allora mettiamo un po di ordine


    ho quest'ultimo script aggiornato

    <?xml version=""1.0"" encoding=""UTF-8""?>








    <%
    'NUMERO RISULTATI
    Dim objRS, strSQL

    strSQL = "SELECT pub.*,imm.agenzia,imm.tipoimmobile,imm.uso,imm.com une,imm.prezzo,imm.mq,imm.tipooperazione FROM pubblicita pub inner join immobili imm on imm.codiceimmobile=pub.codiceimmobile WHERE pub.testatapubblicita = 'CASAIT'"


    If Request.Form("data1")<>"" and IsDate(Request.Form("data1")) Then
    Data = Cdate(request.form("data1"))
    strSQL = strSQL & " and pub.datapubblicita >= dateserial(" & year(Data) & "," & Month(Data) & "," & Day(Data) & ")"
    End IF

    If Request.Form("data2")<>"" and IsDate(Request.Form("data2")) Then
    Data = DateAdd("d",1,Cdate(request.form("data2")))
    strSQL = strSQL & " and pub.datapubblicita < dateserial(" & year(Data) & "," & Month(Data) & "," & Day(Data) & ")"
    End IF



    Set objrs = Server.CreateObject("ADODB.Recordset")
    objrs.cursorlocation = 3
    objrs.Open strSQL, cn


    %>




    <%



    '*** NUMERO DI RECORDS PER PAGINA ******
    Const RECORDSPERPAGE = 10000
    '***************************************



    objrs.PageSize = RECORDSPERPAGE

    If ( Request("pn") <> "" ) Then
    intPageNum = CInt(Request("pn"))
    Else
    intPageNum = 1
    End If

    'Conteggio delle righe
    intNumRows = objrs.RecordCount

    If (intNumRows <> 0) Then
    objrs.AbsolutePage = intPageNum
    'Esposizione dati
    For intCount = 1 To objrs.PageSize



    response.write "Scrittura eseguita correttamente. Visualizza"

    %>



    <%
    Dim OggFile, origine, OggTextStream
    origine=server.Mappath("/public/file.xml")
    Set fso = CreateObject("Scripting.FileSystemObject")
    fso.CreateTextFile (origine)
    Set OggFile = fso.GetFile (origine)
    Set OggTextStream = OggFile.OpenAsTextStream(2)
    OggTextStream.WriteLine "<?xml version=""1.0"" encoding=""UTF-8""?>"





    OggTextStream.WriteLine "<codici>"
    OggTextStream.WriteLine "<reference>"& objrs("codiceimmobile") &"</reference>"
    OggTextStream.WriteLine "</codici>"


    OggTextStream.close



    %>



    <%
    objrs.MoveNext
    If ( objrs.EOF ) Then Exit For
    Next
    End If



    %>






















    <%


    Sub PrintFoto(ByVal sCodiceimmobile)
    Dim oCon1
    Dim oCon2
    Dim oRS1
    Dim oRS2

    Set oCon1 = Server.CreateObject("ADODB.Connection")
    Set oCon2 = Server.CreateObject("ADODB.Connection")
    Set oRS1 = Server.CreateObject("ADODB.Recordset")
    Set oRS2 = Server.CreateObject("ADODB.Recordset")

    oCon1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../public/databaseimm.mdb") & ";Mode=ReadWrite"
    oCon2.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../public/databaseimm.mdb") & ";Mode=ReadWrite"
    Set oRS1 = oCon1.Execute("select TOP 10 Indice from fotocasait where CodiceImmobile=" & sCodiceimmobile & " and Pubblica <>0 order by Indice")
    While Not oRS1.Eof

    Set oRS2 = oCon2.Execute("select Foto" & oRS1("Indice") & " As Foto from immobili where CodiceImmobile=" & sCodiceimmobile)
    Response.Write "&lt;advertismentimage path=""http://www.mediacasaitalia.it/public/" & oRS2("Foto") & """ imagetype=""Image"" />
    "

    oRS2.Close
    oRS1.MoveNext
    Wend

    oRS1.Close
    oCon1.Close
    oCon2.Close

    Set oRS1 = Nothing
    Set oRS2 = Nothing
    Set oCon1 = Nothing
    Set oCon2 = Nothing

    End Sub





    %>


    mi dovrebbe fare un loop del codice xml tra <codice>e </codice>
    e nn lo fa ma fa un loop solo in visualizza xml cosa devo correggere nello script


    fatemi sapere

  3. #3
    Utente di HTML.it
    Registrato dal
    Jul 2003
    Messaggi
    583
    con un po di fatica ho creato questo


    <%@ language="VBScript"%>
    <?xml version="1.0" encoding="UTF-8"?>
    <%
    'NUMERO RISULTATI
    Dim rs, strSQL
    StrConnessione = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & _
    server.MapPath("/public") & "\databaseimm.mdb"

    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open StrConnessione


    strSQL = "SELECT pub.*,imm.agenzia,imm.tipoimmobile,imm.uso,imm.com une,imm.prezzo,imm.mq,imm.tipooperazione FROM pubblicita pub inner join immobili imm on imm.codiceimmobile=pub.codiceimmobile WHERE pub.testatapubblicita = 'CASAIT'"







    Set rs = Server.CreateObject("ADODB.RecordSet")
    rs.CursorLocation = 3
    rs.Open strSQL, Conn, 1,1



    %>
    <thumbnails>
    <%
    While NOT rs.EOF
    %>
    <thumbnail filename="<%=rs("codiceimmobile")%>" /></thumbnail>
    <%rs.MoveNext: Wend %>
    </thumbnails>
    <%


    Sub PrintFoto(ByVal sCodiceimmobile)
    Dim oCon1
    Dim oCon2
    Dim oRS1
    Dim oRS2

    Set oCon1 = Server.CreateObject("ADODB.Connection")
    Set oCon2 = Server.CreateObject("ADODB.Connection")
    Set oRS1 = Server.CreateObject("ADODB.Recordset")
    Set oRS2 = Server.CreateObject("ADODB.Recordset")

    oCon1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../public/databaseimm.mdb") & ";Mode=ReadWrite"
    oCon2.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../public/databaseimm.mdb") & ";Mode=ReadWrite"
    Set oRS1 = oCon1.Execute("select TOP 10 Indice from fotocasait where CodiceImmobile=" & sCodiceimmobile & " and Pubblica <>0 order by Indice")
    While Not oRS1.Eof

    Set oRS2 = oCon2.Execute("select Foto" & oRS1("Indice") & " As Foto from immobili where CodiceImmobile=" & sCodiceimmobile)
    Response.Write "&lt;advertismentimage path=""http://www.mediacasaitalia.it/public/" & oRS2("Foto") & """ imagetype=""Image"" />
    "

    oRS2.Close
    oRS1.MoveNext
    Wend

    oRS1.Close
    oCon1.Close
    oCon2.Close

    Set oRS1 = Nothing
    Set oRS2 = Nothing
    Set oCon1 = Nothing
    Set oCon2 = Nothing

    End Sub





    %>

    <%
    rs.close
    Set rs = nothing

    %>



    non da nessun risultato a questa pagina c'è un modo per visualizzare lo script xml oppure un redirect ad una pagina xml che crea ogni volta?

    Fatemi sapere.
    Grazie dell'aiuto

  4. #4
    Utente di HTML.it
    Registrato dal
    Jul 2003
    Messaggi
    583
    Continuo con l'aggiornamento

    si puo visionare qui http://www.mediacasaitalia.it/casait/codice1.asp

    attualmente il codice lo vedo a video ed è corretto .

    ho bisogno di inserire una scritta " visualizza codice " che mi permetta di creare lo stesso file xml e sia direttamente aggiornato anche senza cliccarci

    questo il mio attuale codice :

    <%@ language="VBScript"%>



    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <?xml version="1.0" encoding="UTF-8"?>

    <%
    'NUMERO RISULTATI
    Dim rs, rs1, rs2, strSQL



    StrConnessione = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & _
    server.MapPath("/public") & "\databaseimm.mdb"

    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open StrConnessione


    strSQL = "SELECT pub.*,imm.agenzia,imm.tipoimmobile,imm.uso,imm.com une,imm.prezzo,imm.mq,imm.tipooperazione FROM pubblicita pub inner join immobili imm on imm.codiceimmobile=pub.codiceimmobile WHERE pub.testatapubblicita = 'CASAIT'"

    Set rs = Server.CreateObject("ADODB.RecordSet")
    rs.CursorLocation = 3
    rs.Open strSQL, Conn, 1,1


    origine=server.Mappath("/public/file.xml")
    Set rs1 = CreateObject("Scripting.FileSystemObject")
    rs1.CreateTextFile (origine)

    response.write "Scrittura eseguita correttamente. Visualizza"



    %>

    <XMP>
    <thumbnails>
    <%
    While NOT rs.EOF
    %>
    <thumbnail filename="<%=rs("codiceimmobile")%>" /></thumbnail>
    <%rs.MoveNext: Wend %>
    </thumbnails>


    </XMP>



    <%


    Sub PrintFoto(ByVal sCodiceimmobile)
    Dim oCon1
    Dim oCon2
    Dim oRS1
    Dim oRS2

    Set oCon1 = Server.CreateObject("ADODB.Connection")
    Set oCon2 = Server.CreateObject("ADODB.Connection")
    Set oRS1 = Server.CreateObject("ADODB.Recordset")
    Set oRS2 = Server.CreateObject("ADODB.Recordset")

    oCon1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../public/databaseimm.mdb") & ";Mode=ReadWrite"
    oCon2.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../public/databaseimm.mdb") & ";Mode=ReadWrite"
    Set oRS1 = oCon1.Execute("select TOP 10 Indice from fotocasait where CodiceImmobile=" & sCodiceimmobile & " and Pubblica <>0 order by Indice")
    While Not oRS1.Eof

    Set oRS2 = oCon2.Execute("select Foto" & oRS1("Indice") & " As Foto from immobili where CodiceImmobile=" & sCodiceimmobile)
    Response.Write "&lt;advertismentimage path=""http://www.mediacasaitalia.it/public/" & oRS2("Foto") & """ imagetype=""Image"" />
    "

    oRS2.Close
    oRS1.MoveNext
    Wend

    oRS1.Close
    oCon1.Close
    oCon2.Close

    Set oRS1 = Nothing
    Set oRS2 = Nothing
    Set oCon1 = Nothing
    Set oCon2 = Nothing

    End Sub





    %>

    <%
    rs.close
    Set rs = nothing

    %>



    ho provato ad inserire


    origine=server.Mappath("/public/file.xml")
    Set rs1 = CreateObject("Scripting.FileSystemObject")
    rs1.CreateTextFile (origine)

    response.write "Scrittura eseguita correttamente. Visualizza"



    ma niente,


    per cortesia ho bisogno di una mano.

    ciao

  5. #5
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    Io non ho capito cosa vuoi/devi fare ma forse qui trovi spunti/aiuti.
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  6. #6
    Utente di HTML.it
    Registrato dal
    Jul 2003
    Messaggi
    583
    ora ti spiego vedi quel codice visualizzato in quella pagina asp vorrei creare in automatico una pagina xml che ha lo stesso codice basta cosi.

  7. #7
    Utente di HTML.it
    Registrato dal
    Jul 2003
    Messaggi
    583
    <%
    'NUMERO RISULTATI


    'assegno il nome al file XML che voglio creare
    Dim filename
    filename = "/public/filexml.xml"

    'verifico se esiste già un file XML con lo stesso nome
    Dim fso
    Set fso = Server.CreateObject("Scripting.FileSystemObject")
    'se esiste eliminalo
    if fso.FileExists(Server.MapPath(filename)) then
    fso.DeleteFile(Server.MapPath(filename))
    end if

    Set fso = Nothing

    Dim cn, rs, sql

    Set cn = server.createobject("ADODB.Connection")
    cn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath("/public/databaseimm.mdb"))

    sql = "SELECT pub.*,imm.tipoimmobile,imm.uso,imm.comune,imm.prez zo,imm.mq,imm.tipooperazione FROM pubblicita pub inner join immobili imm on imm.codiceimmobile=pub.codiceimmobile WHERE pub.testatapubblicita = 'TUTTOSHOPPINGONLINE' order by pub.datapubblicita DESC"
    Set rs = cn.Execute (sql)
    rs.Save Server.MapPath(filename), 1

    %>


    <%

    xmlContent = xmlContent & "<meta http-equiv=""charset"" content=""utf-8""> "

    %>


    <%

    Response.Write("Per visualizzare il file XML appena creato clicca qui.")
    %>


    e mi stampa questo xml


    - <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
    - <s:Schema id="RowsetSchema">
    - <s:ElementType name="row" content="eltOnly">
    - <s:AttributeType name="id" rs:number="1" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="int" dt:maxLength="4" rsrecision="10" rs:fixedlength="true" />
    </s:AttributeType>
    - <s:AttributeType name="codiceimmobile" rs:number="2" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="int" dt:maxLength="4" rsrecision="10" rs:fixedlength="true" />
    </s:AttributeType>
    - <s:AttributeType name="testopubblicita" rs:number="3" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="536870910" rs:long="true" />
    </s:AttributeType>
    - <s:AttributeType name="testatapubblicita" rs:number="4" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="datapubblicita" rs:number="5" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="dateTime" rs:dbtype="variantdate" dt:maxLength="16" rs:fixedlength="true" />
    </s:AttributeType>
    - <s:AttributeType name="pubblicitasino" rs:number="6" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="foto" rs:number="7" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="agenzia" rs:number="8" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="logo" rs:number="9" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="indirizzo" rs:number="10" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="citta" rs:number="11" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="telefono" rs:number="12" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="email" rs:number="13" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="sitoweb" rs:number="14" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="tipoimmobile" rs:number="15" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="uso" rs:number="16" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="comune" rs:number="17" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    - <s:AttributeType name="prezzo" rs:number="18" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="float" dt:maxLength="8" rsrecision="15" rs:fixedlength="true" />
    </s:AttributeType>
    - <s:AttributeType name="mq" rs:number="19" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="float" dt:maxLength="8" rsrecision="15" rs:fixedlength="true" />
    </s:AttributeType>
    - <s:AttributeType name="tipooperazione" rs:number="20" rs:nullable="true" rs:maydefer="true" rs:writeunknown="true">
    <s:datatype dt:type="string" dt:maxLength="50" />
    </s:AttributeType>
    <s:extends type="rs:rowbase" />
    </s:ElementType>
    </s:Schema>
    - <rs:data>
    <z:row id="3616" codiceimmobile="2615" />
    </rs:data>
    </xml>

    lo schema pero nn dovrebbe essere cosi ma cosi


    <?xml version="1.0" encoding="UTF-8" ?>
    - <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://feed.immobiliare.it" xmlns="http://feed.immobiliare.it" elementFormDefault="qualified">
    - <!-- TYPES DEFINITIONS
    -->
    - <xs:simpleType name="nullString">
    - <xs:restriction base="xs:string">
    <xs:maxLength value="0" />
    </xs:restriction>
    </xs:simpleType>
    - <!-- Publisher complex type
    -->
    - <xs:complexType name="publisher">
    - <xs:all>
    <xs:element name="name" type="xs:string" />
    <xs:element name="site" type="xs:string" minOccurs="0" />
    <xs:element name="email" type="xs:string" />
    <xs:element name="phone" type="xs:string" />
    </xs:all>
    </xs:complexType>
    - <!-- Operation
    -->
    - <xs:simpleType name="operation">

    </xml

    come posso personalizzarlo datemi una dritta fatemi sapere

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.