Subject: option list using XSL From: Marco.Mistroni@xxxxxxxxx Date: Thu, 20 Jan 2000 14:06:17 +0200 |
hi all, i have a problem. i am using Xalan as XSL processor i have an xml file like this <animal name="lion"/> <animal name="panda"/> <animal name="dog"/> <animal name="cat" /> from this, i should generate an option list ideally the result should be like this: <select name="zoo"> <option value="lion">lion</option> <option value="panda">panda</option> <option value="dog">dog</option> <option value="cat">cat</option> </select> i have no problem with the <select> tag, but the problem is how to generate each option..... i should use <xsl:value-of select="."> but i got only the name of the attribute once, and i need it twice if i do like this: <xsl:template match="animal/@name"> <option> <xsl:attribute name="value"/><xsl:value-of select="."> <xsl:value-of select="."/> </option> is it correct?? sorry for my ignorance thanx and regards marco > -----Original Message----- > From: EXT Stefano Mazzocchi [mailto:stefano@xxxxxxxxxx] > Sent: 19. January 2000 16:20 > To: Marco.Mistroni@xxxxxxxxx > Subject: Re: info/XSL > > > Marco.Mistroni@xxxxxxxxx wrote: > > > > ciao stefano, > > volevo chiederti una cosa.. > > io sto usando Xalan come XSL processor, e ho un problema: > sto cercando di > > trasformare XML in WML via XSL... > > ho gia' lo stylesheet....... > > il mio problema e' questo > > supponi che io abbia questo xml file (non ho messo le > virgolette, non fa > > niente) > > <animal name=tiger /> > > <animal name=lion /> > > <animal name=dog /> > > <animal name=cat /> > > <animal name=bear /> > > > > ebbene, io vorrei creare una form in WML con un input > field per ogni animal > > , in cui posso indircare il nome...eppoi passare tutto ad > un servlet che > > 'parses' i parametri > > e li invia in System.out > > ora, per fare cio' io devo creare prima gli input fields > > <input name=cat > > <input name=dog > > <input name=tiger > > ecc.... > > > > dopodiche', affinche' questi dati vengano inviati al servlet, devo > > 'costruire un altro tag > > <do type=accept> > > <go href=http://myservlet method=post> > > <setvar cat=$cat > > <setvar dot=$dog > > <setvar lion=$lion > > eccetera.... > > > > siccome sono due parti distinte del WML file, questo mi > richiederebbe > > processare due volte il file XML a meno che: > > - il processore XML tenga in memoria tutti i valori > dell'attributo name di > > ogni <animal> tag (questo e' molto improbabile, stando a > quanto so dei > > processori XSL > > - crei diverse variabili per ogni name attribute (nel file > XSL) eppoi con > > un for loop passo in rassegna tutte le variabili del file > XSL e mando in > > output un <setvar per ogni variabile > > > > dando per scontato che la prima soluzione sia impossibile, > la seconda lo > > e'?? > > Mah, io userei un database, come in ogni web service che si rispetti, > oppure una pool condivisa tra le servlet. Ma ammetto che ci ho capito > poco. > > (inoltre, perchè usi servlet è maschile? la servlet, non il servlet). > > -- > Stefano Mazzocchi One must still have chaos in oneself to be > able to give birth to a dancing star. > <stefano@xxxxxxxxxx> Friedrich Nietzsche > -------------------------------------------------------------------- > Come to the first official Apache Software Foundation Conference! > ------------------------- http://ApacheCon.Com --------------------- > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Query Regarding XSL, Steve Tinney | Thread | Re: option list using XSL, Steve Tinney |
Re: position() of the parent, David Carlisle | Date | XSLT/XPATH jargon, Pawson, David |
Month |