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

    da asp a xml formattazione diversa

    Buon giorno a tutti, ho un filmato flash che mi carica una galleria da xml.... fino a qui tutto funziona. Il codice xml generato è
    Codice PHP:
      <?xml version="1.0" encoding="iso-8859-1" ?>  
     <?xml version="1.0" encoding="iso-8859-1" ?> 
    - <galleryXML>
      <gallerySettings galleryTitle="COLOR GALLERY" thumbWidth="175" thumbHeight="100" numColumns="4" numRows="4" thumbSpace="5" frameSpace="50" /> 
    - <galleryItems>
      <image title="COLOR PHOTO 01" description="LOREM IPSUM DOLOR SIT AMET, CONSECTETUER ADIPISCING ELIT. SED PRETIUM LACUS VEL NUNC. DONEC DUI MAGNA, ULLAMCORPER AT, FAUCIBUS CONVALLIS, HENDRERIT ID, NISI. UT VOLUTPAT POSUERE DIAM. PROIN AT MAURIS. ALIQUAM PELLENTESQUE NONUMMY FELIS. PRAESENT NEQUE MAGNA." thumbDescription="COLOR 01" imagePath="Galleries/Color Gallery/COLOR-01.jpg" thumbPath="Galleries/Color Gallery/Thumbnails/COLOR-01.jpg" backgroundPath="Galleries/Color Gallery/Backgrounds/COLOR-01.jpg" url="http://www.keidea.net" />
    adesso ho deciso di far caricare la galleria dinamicamente in asp e db access.
    Ho trovato questo script
    Codice PHP:
    <%@LANGUAGE="VBSCRIPT"%>
    <% Response.ContentType="application/xml" %>
    <?xml version="1.0" encoding="iso-8859-1"?>
    <galleryxml>
       <gallerysettings
             galleryTitle="Acquari"
              thumbWidth="175"
              thumbHeight="100"
              numColumns="5"
              numRows="2"
              thumbSpace="10"
              frameSpace="10"
        ></gallerysettings>
      <galleryitems>
        <%
    dim adoConnect
    dim adoRecordset

    Set adoConnect = Server.CreateObject("Adodb.Connection")
    adoConnect.open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("../../mdb-database/acquari.mdb")

    Set adoRecordset = adoConnect.Execute("SELECT * FROM Prodotti")

    Do while not adoRecordset.EOF%>
        <image>
          <%
    response.write "<title>" +  adoRecordset("Nome_prodotto") + "</title>" 
    response.write "<description>" +  adoRecordset("Descrizione") + "</description>"
    response.write "<thumbDescription>" +  adoRecordset("Nome_Breve") + "</thumbDescription>"
    response.write "<imagePath>" +  adoRecordset("Foto_prew") + "</imagePath>"
    response.write "<thumbPath>" +  adoRecordset("Foto_Thumb") + "</thumbPath>"
    response.write "<url>" +  adoRecordset("Email_Subject") + "</url>"
    %>
       </image>
        <%        adoRecordset.MoveNext
            Loop
            
            adoRecordset.Close
            Set adoRecordset = Nothing
            adoConnect.Close
            Set adoConnect = Nothing
            
    %>
      </galleryitems>
    </galleryxml>
    che mi estrae i dati regolarmente ma li formatta in maniera diversa da quello che ho come base
    Codice PHP:
      <?xml version="1.0" encoding="iso-8859-1" ?> 
     - <galleryxml>   <gallerysettings galleryTitle="Acquari" thumbWidth="175" thumbHeight="100" numColumns="5" numRows="2" thumbSpace="10" frameSpace="10" />  - <galleryitems> - <image>   <title>Pesce Cometa con grande coda rossa</title>    <description>Pesce con pinna retro molto bella, generalmente di colore rosso</description>    <thumbDescription>Pesce cometa</thumbDescription>    <imagePath>Galleries/acquari/acquari-01.jpg</imagePath>    <thumbPath>Galleries/acquari/Thumbnails/acquari-01.jpg</thumbPath>    <url>Pesce Cometa</url>    </image> - <image>   <title>Pesce rosso</title>    <description>LOREM IPSUM DOLOR SIT AMET, CONSECTETUER ADIPISCING ELIT. SED PRETIUM LACUS VEL NUNC. DONEC DUI MAGNA,</description>    <thumbDescription>Pesce rsso e nero</thumbDescription>    <imagePath>Galleries/acquari/acquari-02.jpg</imagePath>    <thumbPath>Galleries/acquari/Thumbnails/acquari-02.jpg</thumbPath>    <url>Pesce rosso</url>    </image>   </galleryitems>   </galleryxml>
    sapete dirmi come poter formattare xml come il suo originale altrimenti flash non mi carica niente

    Graizie a tutti

  2. #2

    nuova spiegazione

    Ho un file VBSCRIPT al quale ho chiesto di estrarre da un DB i risultati di una tabelle e riscrivere in un nodo xml.
    Questo è lo script che scrive il risultato

    <image>
    <%
    response.write "<title>" + adoRecordset("Nome_prodotto") + "</title>"
    response.write "<description>" + adoRecordset("Descrizione") + "</description>"
    response.write "<thumbDescription>" + adoRecordset("Nome_Breve") + "</thumbDescription>"
    response.write "<imagePath>" + adoRecordset("Foto_prew") + "</imagePath>"
    response.write "<thumbPath>" + adoRecordset("Foto_Thumb") + "</thumbPath>"
    response.write "<url>" + adoRecordset("Email_Subject") + "</url>"
    %>
    <image>

    Il risultato è
    - <image>
    <title>Pesce Cometa con grande coda rossa</title>
    <description>Pesce con pinna retro molto bella, generalmente di colore rosso</description>
    <thumbDescription>Pesce cometa</thumbDescription>
    <imagePath>Galleries/acquari/acquari-01.jpg</imagePath>
    <thumbPath>Galleries/acquari/Thumbnails/acquari-01.jpg</thumbPath>
    <url>Pesce Cometa</url>
    </image>

    come devo fare la stringa di scrittura per poter ottenere questa formattazione nel risultato?

    <image title="Pesce Cometa con grande coda rossa" description="Pesce con pinna retro molto bella, generalmente di colore rosso" thumbDescription="Pesce cometa" imagePath="Galleries/acquari/acquari-01.jpg" thumbPath="Galleries/acquari/Thumbnails/acquari-01.jpg" url="http://www.xxx.it" />
    ---------
    speriamo che qualcuno mi aiuti xché sono giorni che cerco e provo senza alcun risultato

  3. #3

    RISOLTO - trovata formattazione giusta

    dopo una settimana di tentativi (ad avanza tempo, ovviamente) sono riuscito a trovare la soluzione per la formattazione della risposta.
    ------------------
    questa è la stringa
    ---
    response.write ((" <image title=""" & adoRecordset("Nome_prodotto") & """ description=""" & adoRecordset("Descrizione") & """ thumbDescription=""" & adoRecordset("Nome_Breve") & """ imagePath=""" & adoRecordset("Foto_prew") + """ thumbPath=""" & adoRecordset("Foto_Thumb") & """ url=""" & adoRecordset("Email_Subject") & """/>"))
    ---
    Spero che sia utile a qualcuno.
    Buon forum a tutti

    p.s. ovviamente i campi sono del mio specifico caso ma possono essere cambiati a piacimento

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.