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

    utilizzare xsl e css insieme

    Ciao a tutti...questo è il mio primo messaggio su questo forum e a dire il vero in assoluto...
    mi servirebbe tanto il vostro aiuto...dovrei inserire un foglio di stile interno(css) in un file .xsl..questo è il file .xsl (che ovviam trasforma un file .xml)

    ?xml version="1.0" encoding="ISO-8859-1"?>

    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">


    <xsl:template match="/">



    <html>
    <body>
    <table border="2">
    <th align="center" colspan="5"><xsl:value-of select="//nome_scuola"/><xsl:value-of select="//indirizzo_scuola"/></th>


    <tr>
    <td><primo>classe</primo></td>
    <td>sezione</td>
    <td>sperimentazione</td>
    <td>indirizzo</td>
    <td>nr. studenti</td>
    </tr>


    <xsl:for-each select="scrutinio/classe">
    <tr>
    <td><xsl:value-of select="@classe"/></td>
    <td><xsl:value-of select="@sezione"/></td>
    <td><xsl:value-of select="@sperimentazione"/></td>
    <xsl:choose>
    <xsl:when test="@indirizzo = 'informatico'">
    <td bgcolor ="green"><xsl:value-of select="@indirizzo"/>
    </td>
    </xsl:when>
    <xsltherwise>
    <td bgcolor ="yellow"><xsl:value-of select="@indirizzo"/>
    </td>
    </xsltherwise>
    </xsl:choose>
    <td><xsl:value-of select="count(studente)"/></td>

    </tr>



    </xsl:for-each>

    </table>


    <table border="2">
    <tr>
    <td>nome</td>
    <td>cognome</td>
    <td>data nascita</td>
    <td>classe</td>
    <td>italiano</td>
    <td>matematica</td>
    <td>caratterizzante</td>
    <td>condotta</td>
    <td>sezione</td>
    <td>esito</td>
    </tr>

    <xsl:for-each select="scrutinio/classe">

    <xsl:for-each select="studente">
    <tr>
    <td><xsl:value-of select="nome"/></td>
    <td><xsl:value-of select="cognome"/></td>
    <td><xsl:value-of select="datanascita"/></td>
    <td><xsl:value-of select="../@classe"/></td>
    <td><xsl:value-of select="@italiano"/></td>
    <td><xsl:value-of select="@matematica"/></td>
    <td><xsl:value-of select="@caratterizzante"/></td>
    <td><xsl:value-of select="@condotta"/></td>
    <td><xsl:value-of select="../@sezione"/></td>

    <xsl:variable name="media"><xsl:value-of select="(@italiano+@matematica+@caratterizzante+@c ondotta) div 4"/></xsl:variable>
    <xsl:value-of select="$media"/>

    <xsl:choose>
    <xsl:when test="$media &gt;= '6'">
    <td bgcolor ="green"><xsl:value-of select="$media"/>
    </td>
    </xsl:when>
    <xsltherwise>
    <td bgcolor ="red"><xsl:value-of select="$media"/>
    </td>
    </xsltherwise>
    </xsl:choose>





    </tr>
    </xsl:for-each>
    </xsl:for-each>
    </table>

    </body>
    </html>

    </xsl:template>
    </xsl:stylesheet>




    se..mi potete dare delle delucidazioni ne sarei molto grato..sia per inserimento esterno che interno del file .css Grazie ciaooo

  2. #2
    Utente di HTML.it L'avatar di nourdine
    Registrato dal
    Nov 2005
    Messaggi
    1,130
    basta che lo metti in head! come faresti normalmente in un file html

    codice:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    
    
    <xsl:template match="/">
    
    
    
    <html>
    
    
    
    
    <head>
    
    <style type="text/css">
    </style>
    
    </head>
    
    
    <body>
    <table border="2">
    <th align="center" colspan="5"><xsl:value-of select="//nome_scuola"/><xsl:value-of select="//indirizzo_scuola"/></th>
    
    
    <tr>
    <td><primo>classe</primo></td>
    <td>sezione</td>
    <td>sperimentazione</td>
    <td>indirizzo</td>
    <td>nr. studenti</td>
    </tr>
    
    
    <xsl:for-each select="scrutinio/classe">
    <tr>
    <td><xsl:value-of select="@classe"/></td>
    <td><xsl:value-of select="@sezione"/></td>
    <td><xsl:value-of select="@sperimentazione"/></td>
    <xsl:choose>
    <xsl:when test="@indirizzo = 'informatico'">
    <td bgcolor ="green"><xsl:value-of select="@indirizzo"/>
    </td>
    </xsl:when>
    <xsl:otherwise>
    <td bgcolor ="yellow"><xsl:value-of select="@indirizzo"/>
    </td>
    </xsl:otherwise>
    </xsl:choose>
    <td><xsl:value-of select="count(studente)"/></td>
    
    </tr>
    
    
    
    </xsl:for-each>
    
    </table>
    
    
    <table border="2">
    <tr>
    <td>nome</td>
    <td>cognome</td>
    <td>data nascita</td>
    <td>classe</td>
    <td>italiano</td>
    <td>matematica</td>
    <td>caratterizzante</td>
    <td>condotta</td>
    <td>sezione</td>
    <td>esito</td>
    </tr>
    
    <xsl:for-each select="scrutinio/classe">
    
    <xsl:for-each select="studente">
    <tr>
    <td><xsl:value-of select="nome"/></td>
    <td><xsl:value-of select="cognome"/></td>
    <td><xsl:value-of select="datanascita"/></td>
    <td><xsl:value-of select="../@classe"/></td>
    <td><xsl:value-of select="@italiano"/></td>
    <td><xsl:value-of select="@matematica"/></td>
    <td><xsl:value-of select="@caratterizzante"/></td>
    <td><xsl:value-of select="@condotta"/></td>
    <td><xsl:value-of select="../@sezione"/></td>
    
    <xsl:variable name="media"><xsl:value-of select="(@italiano+@matematica+@caratterizzante+@condotta) div 4"/></xsl:variable>
    <xsl:value-of select="$media"/>
    
    <xsl:choose>
    <xsl:when test="$media &gt;= '6'">
    <td bgcolor ="green"><xsl:value-of select="$media"/>
    </td>
    </xsl:when>
    <xsl:otherwise>
    <td bgcolor ="red"><xsl:value-of select="$media"/>
    </td>
    </xsl:otherwise>
    </xsl:choose>
    
    
    
    
    
    </tr>
    </xsl:for-each>
    </xsl:for-each>
    </table>
    
    </body>
    </html>
    
    </xsl:template>
    </xsl:stylesheet>

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.