Visualizzazione dei risultati da 1 a 7 su 7

Discussione: [XSLT] da xml a xml

  1. #1
    Utente di HTML.it L'avatar di munky
    Registrato dal
    May 2001
    Messaggi
    381

    [XSLT] da xml a xml

    ciao a tutti!
    Ho bisogno di effettuare una trasformazione di un xml tramite xsl, che restituisca come output un altro file xml.

    ho utilizzato il comando <xslutput method="xml"/> ma il risultato che viene fuori č il contenuto dei tag ANNO e non ha la formattazione di un file xml.
    questo č il mio file xsl
    codice:
    <?xml version='1.0'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    <xsl:output method="xml"/>
    	<xsl:variable name="tipoFiltro">anno</xsl:variable>
    	<xsl:template match="/">
    		<filtro>
    			<xsl:apply-templates select="elementi/elemento">
    			   <xsl:sort select="@filtro"/>
    			</xsl:apply-templates>
    		</filtro>
    	</xsl:template>
    	<xsl:template match="elemento">
    		<xsl:if test="sottoel/@tipoFiltro = $tipoFiltro">
    			<anno>
    				<xsl:value-of select="sottoel/@filtro"/>
    			</anno>
    		</xsl:if>
    	</xsl:template>
    </xsl:stylesheet>
    don't surf the net...make the waves!

    ..::> finger deep within the borderline <::..

  2. #2
    Il tuo parser legge il method XML ?? non e' che devi passarglielo come parametro?
    Are you alive?
    No, but I was written with LOVE. A new scripting language.
    www.frequenze.it

  3. #3
    Utente di HTML.it L'avatar di munky
    Registrato dal
    May 2001
    Messaggi
    381
    ehm....come faccio a sapere se lo legge?!?
    in caso non lo leggesse, cosa dovrei fare per passarglielo come parametro?
    don't surf the net...make the waves!

    ..::> finger deep within the borderline <::..

  4. #4
    Avrai un manuale a disposizione... o no? Che parser usi?
    Are you alive?
    No, but I was written with LOVE. A new scripting language.
    www.frequenze.it

  5. #5
    Utente di HTML.it L'avatar di munky
    Registrato dal
    May 2001
    Messaggi
    381
    nessun manuale....
    diciamo che sto imparando tramite tutorials presi qua e lā...
    mi daresti una mano a scoprirlo?
    abbi pazienza...sono uno che corre un po' troppo?!
    don't surf the net...make the waves!

    ..::> finger deep within the borderline <::..

  6. #6
    ok. come fai la trasformazione?
    Are you alive?
    No, but I was written with LOVE. A new scripting language.
    www.frequenze.it

  7. #7
    Utente di HTML.it L'avatar di munky
    Registrato dal
    May 2001
    Messaggi
    381
    in questo modo:
    <?xml:stylesheet type="text/xsl" href="file.xsl" ?>
    don't surf the net...make the waves!

    ..::> finger deep within the borderline <::..

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.