Subversion Repositories bacoAlunos

Rev

Blame | Compare with Previous | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:curso="http://www.estgp.pt/xsd/planoestudos/1.0/">

        <xsl:template match="/">
        <html>
                <head>
               
                        <title></title>
                        <meta content="UTF-8" http-equiv="encoding"></meta>
                        <style type="text/css">
                                .planoCurricular
                                {
                                        border:1px solid black;

                                }
                                .planoCurricular th
                                {
                                   font-weight:normal;
                                        border:1px solid black;

                                }
                                .planoCurricular td.unidade
                                {
                                        border:1px solid black;
                                }                              
                                td.unidade span
                                {
                                        width:100%;                            
                                }
                                .semestre
                                {
                                        background-color:#8ec73f;
                                }
                                .semestreHead
                                {
                                        background-color:#8ec73f;
                                }                              
                                .perfilNome, .perfilHead
                                {
                                        background-color:#D6D6D6
                                }
                                .ects
                                {
                                        background-color:#EBFCD6;
                                }                              
                        </style>
                </head>
                <body>
                <div class="seccao">
                        <table class="planoCurricular">
                                <xsl:for-each select="//curso:semestre">
                                        <tr>
                                                <th class="semestre">
                                                        <xsl:if test="./curso:perfil">
                                                                <xsl:attribute name="colspan">13</xsl:attribute>
                                                        </xsl:if>
                                                        <xsl:choose>
                                                                <xsl:when test="@id = 'S1'">1º ano 1º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S2'">1º ano 2º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S3'">2º ano 1º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S4'">2º ano 2º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S5'">3º ano 1º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S6'">3º ano 2º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S7'">4º ano 1º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S8'">4º ano 2º semestre</xsl:when>                                                                                                                                                                                            
                                                                <xsl:when test="@id = 'S9'">5º ano 1º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S10'">5º ano 2º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S11'">6º ano 1º semestre</xsl:when>
                                                                <xsl:when test="@id = 'S12'">6º ano 2º semestre</xsl:when>
                                                                <xsl:otherwise><xsl:value-of select="@id"/></xsl:otherwise>                                                            
                                                        </xsl:choose>
                                                </th>
                                                <xsl:if test="not(./curso:perfil)">
                                                        <th class="semestreHead">total</th>
                                                        <th class="semestreHead">T</th>
                                                        <th class="semestreHead">TP</th>                       
                                                        <th class="semestreHead">P</th>                                                                
                                                        <th class="semestreHead">PL</th>                                                                       
                                                        <th class="semestreHead">PD</th>                                                                       
                                                        <th class="semestreHead">OT</th>                                                                       
                                                        <th class="semestreHead">E</th>                                                                
                                                        <th class="semestreHead">S</th>                                                                                                                
                                                        <th class="semestreHead">TC</th>                                                                                                               
                                                        <th class="semestreHead">O</th>                                                                
                                                        <th class="semestreHead ectsHead">ECTS</th>                                                            
                                                </xsl:if>                                                                                                                                              
                                        </tr>
                                        <xsl:choose>
                                                <xsl:when test="./curso:perfil">
                                                        <xsl:apply-templates select="./curso:perfil" />
                                                </xsl:when>
                                                <xsl:otherwise>
                                                        <xsl:apply-templates select="./curso:unidade" />
                                                </xsl:otherwise>
                                        </xsl:choose>
                                </xsl:for-each>
                        </table>
                </div>
                </body>
        </html>
        </xsl:template>
        <xsl:template match="curso:perfil">
                <tr>
                        <th class="perfilNome">
                                <xsl:value-of select="@nome"/>
                        </th>
                        <th class="perfilHead">total</th>
                        <th class="perfilHead">T</th>
                        <th class="perfilHead">TP</th>                 
                        <th class="perfilHead">P</th>                                                                  
                        <th class="perfilHead">PL</th>                                                                 
                        <th class="perfilHead">PD</th>                                                                 
                        <th class="perfilHead">OT</th>                                                                 
                        <th class="perfilHead">E</th>                                                                  
                        <th class="perfilHead">S</th>                                                                                                                  
                        <th class="perfilHead">TC</th>                                                                                                         
                        <th class="perfilHead">O</th>                                                                                          
                        <th class="perfilHead ectsHead">ECTS</th>                                                                                                                      
                        <xsl:apply-templates select="./curso:unidade" mode="perfil"/>
                </tr>
        </xsl:template>
        <xsl:template match="curso:unidade" mode="perfil">
                <tr>
                        <td  class="perfil unidadeNome"><span><xsl:value-of select="./curso:nome"/></span></td>
                        <td  class="perfil unidade"><span><xsl:value-of select="./curso:totalHoras"/></span></td>                      
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:T"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:T"/></xsl:if></span></td>
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:TP"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:TP"/></xsl:if></span></td>
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:P"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:P"/></xsl:if></span></td>
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:PL"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:PL"/></xsl:if></span></td>
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:PD"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:PD"/></xsl:if></span></td>
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:OT"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:OT"/></xsl:if></span></td>
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:E"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:E"/></xsl:if></span></td>
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:S"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:S"/></xsl:if></span></td>
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:TC"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:TC"/></xsl:if></span></td>
                        <td  class="perfil unidade"><span><xsl:if test="./curso:horasContacto/curso:O"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:O"/></xsl:if></span></td>
                        <td  class="perfil unidade ects"><span><xsl:if test="./curso:ECTS"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:ECTS"/></xsl:if></span></td>
                </tr>
        </xsl:template>
        <xsl:template match="curso:unidade">
                <tr>
                        <td  class="unidadeNome"><span><xsl:value-of select="./curso:nome"/></span></td>
                        <td  class="unidade"><span><xsl:value-of select="./curso:totalHoras"/></span></td>                     
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:T"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:T"/></xsl:if></span></td>
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:TP"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:TP"/></xsl:if></span></td>
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:P"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:P"/></xsl:if></span></td>
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:PL"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:PL"/></xsl:if></span></td>
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:PD"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:PD"/></xsl:if></span></td>
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:OT"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:OT"/></xsl:if></span></td>
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:E"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:E"/></xsl:if></span></td>
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:S"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:S"/></xsl:if></span></td>
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:TC"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:TC"/></xsl:if></span></td>                
                        <td  class="unidade"><span><xsl:if test="./curso:horasContacto/curso:O"><xsl:attribute name="class">unidade celula</xsl:attribute><xsl:value-of select="./curso:horasContacto/curso:O"/></xsl:if></span></td>
                        <td  class="unidade ects"><span><xsl:if test="./curso:ECTS"><xsl:value-of select="./curso:ECTS"/></xsl:if></span></td>                                                                                                                                                                                                                                                                 
                </tr>
        </xsl:template>
</xsl:stylesheet>