Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [XML/XSL] creare una TABLE da un elenco XML
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
0m4r
.grande:maestro.

User info:
Registered: Mar 2002
Posts: 7287 (0.86 al dì)
Location: Düsseldorf (DE)
Corso:
Anno: ESAMI FINITI
Time Online: 49 Days, 0:42:50 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[XML/XSL] creare una TABLE da un elenco XML

sto cercando di creare una tabella da un file XML strutturato più o meno cosi

code:
<root> <node> <pippo>bla bla</pippo> <pluto>bla bla</pluto> </node> <node> <pippo>bla bla</pippo> <pluto>bla bla</pluto> </node> <node> <pippo>bla bla</pippo> <pluto>bla bla</pluto> </node> <node> <pippo>bla bla</pippo> <pluto>bla bla</pluto> </node> ... </root>


ora, attraverso un XSL vorri creare una tabella con "n" celle su ogni riga, ma non so come contare le celle che posiziono sulla stessa righa e nemmeno come poi andare a capo... qualcuno ha un'idea?

__________________
http://www.twitter.com/0m4r

22-12-2004 09:39
Click Here to See the Profile for 0m4r Click Here to See the Blog of 0m4r Click here to Send 0m4r a Private Message Find more posts by 0m4r Add 0m4r to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

una cosa di questo tipo:



code:
<xsl:template match="/"> <xsl:foreach select="node"> <tr><xsl:value-of select="./pippo"/><td>/td><td><xsl:value-of select="./pluto"/></td> </xsl:foreach> <xsl:template>




sinceramente non ne sono molto convinto e siopratutto non sto guardando la documentazione, comunque è una roba simile.

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

22-12-2004 11:14
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
0m4r
.grande:maestro.

User info:
Registered: Mar 2002
Posts: 7287 (0.86 al dì)
Location: Düsseldorf (DE)
Corso:
Anno: ESAMI FINITI
Time Online: 49 Days, 0:42:50 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

in questo modo però, ammesso che funzioni, non potrei variare "dinamicamente" il numero di celle per riga....

__________________
http://www.twitter.com/0m4r

22-12-2004 11:46
Click Here to See the Profile for 0m4r Click Here to See the Blog of 0m4r Click here to Send 0m4r a Private Message Find more posts by 0m4r Add 0m4r to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
fabpicca
jesus robot d'acciaio

User info:
Registered: May 2002
Posts: 2166 (0.26 al dì)
Location: Pieve Emanuele
Corso: Ticom
Anno:
Time Online: 12 Days, 23:12:28 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by 0m4r
in questo modo però, ammesso che funzioni, non potrei variare "dinamicamente" il numero di celle per riga....



il foreach che vedi all'inizio conta tutti i nodi di tipo node.
se vuoi variare i campi della tabella allora aggiungi questo:

code:
<xsl:foreach select="./*"> <td><xsl:valueof select="."></td> </xsl:foreach>


in questo modo vari anche il numero di campi.


./* è l'espressione che identifica tutti i figli del nodo padre.

__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour

"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)

22-12-2004 11:52
Click Here to See the Profile for fabpicca Click Here to See the Blog of fabpicca Click here to Send fabpicca a Private Message Visit fabpicca's homepage! Find more posts by fabpicca Add fabpicca to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
0m4r
.grande:maestro.

User info:
Registered: Mar 2002
Posts: 7287 (0.86 al dì)
Location: Düsseldorf (DE)
Corso:
Anno: ESAMI FINITI
Time Online: 49 Days, 0:42:50 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

scusa ma credo di non avere capito
puoi esemplificarmi, parlando con i numeri, come faccio a fare una riga di 3 celle?

__________________
http://www.twitter.com/0m4r

22-12-2004 12:36
Click Here to See the Profile for 0m4r Click Here to See the Blog of 0m4r Click here to Send 0m4r a Private Message Find more posts by 0m4r Add 0m4r to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 22:39.    Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.074 seconds (41.03% PHP - 58.97% MySQL) con 25 query.