Subversion Repositories bacoAlunos

Rev

Rev 247 | Rev 883 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
504 jmachado 1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:curso="http://www.estgp.pt/xsd/planoestudos/1.0/">
3
 
4
        <xsl:template match="/">
5
        <html>
6
                <head>
7
 
8
                        <title></title>
9
                        <meta content="UTF-8" http-equiv="encoding"></meta>
10
                        <style type="text/css">
11
                                body *, .contentPortal, .contentPortal p, .contentPortal li, div
12
                                {
13
                                        font-family: "bitstream vera sans",Verdana,Arial,Helvetica,sans-serif;
14
                                        font-size: 11px;
15
                                }
16
                                .planoCurricular td,    .planoCurricular th
17
                                {
18
                                        font-family: "bitstream vera sans",Verdana,Arial,Helvetica,sans-serif;                         
19
                                }
20
                                .planoCurricular
21
                                {
22
                                        border:1px solid black;
23
 
24
                                }
25
                                .planoCurricular th
26
                                {
27
                                   font-weight:normal;
28
                                        border:1px solid black;
29
 
30
                                }
31
                                .planoCurricular td.unidade
32
                                {
33
                                                text-align:right;
34
                                }                              
35
                                td.unidade span
36
                                {
37
                                        width:100%;                            
38
                                }
39
                                .semestre
40
                                {
41
                                        background-color:#8ec73f;
42
                                }
43
                                .semestreHead
44
                                {
45
                                        background-color:#8ec73f;
46
                                }                              
47
                                .perfilNome, .perfilHead
48
                                {
49
                                        background-color:#D6D6D6
50
                                }
51
                                .ects
52
                                {
53
                                        background-color:#EBFCD6;
54
                                }                              
55
                        </style>
56
                </head>
57
                <body>
58
                        <xsl:call-template name="fragmentoCurso"/>
59
                </body>
60
                </html>
61
        </xsl:template>
62
        <xsl:template name="fragmentoCurso">
63
                <div class="seccao">
64
                        <table class="planoCurricular">
65
                                <xsl:for-each select="//curso:semestre">
66
                                        <tr>
67
                                                <th class="semestre">
68
                                                        <xsl:if test="./curso:perfil">
69
                                                                <xsl:attribute name="colspan"><xsl:value-of select="count(distinct-values(//curso:horasContacto/*/name())) + 3"/></xsl:attribute>
70
                                                        </xsl:if>
71
                                                        <xsl:choose>
72
                                                                <xsl:when test="@id = 'S1'">1º ano 1º semestre</xsl:when>
73
                                                                <xsl:when test="@id = 'S2'">1º ano 2º semestre</xsl:when>
74
                                                                <xsl:when test="@id = 'S3'">2º ano 1º semestre</xsl:when>
75
                                                                <xsl:when test="@id = 'S4'">2º ano 2º semestre</xsl:when>
76
                                                                <xsl:when test="@id = 'S5'">3º ano 1º semestre</xsl:when>
77
                                                                <xsl:when test="@id = 'S6'">3º ano 2º semestre</xsl:when>
78
                                                                <xsl:when test="@id = 'S7'">4º ano 1º semestre</xsl:when>
79
                                                                <xsl:when test="@id = 'S8'">4º ano 2º semestre</xsl:when>                                                                                                                                                                                            
80
                                                                <xsl:when test="@id = 'S9'">5º ano 1º semestre</xsl:when>
81
                                                                <xsl:when test="@id = 'S10'">5º ano 2º semestre</xsl:when>
82
                                                                <xsl:when test="@id = 'S11'">6º ano 1º semestre</xsl:when>
83
                                                                <xsl:when test="@id = 'S12'">6º ano 2º semestre</xsl:when>
84
                                                                <xsl:when test="@id = 'A1'">Anuais 1º Ano</xsl:when>
85
                                                                <xsl:when test="@id = 'A2'">Anuais 2º Ano</xsl:when>
86
                                                                <xsl:when test="@id = 'A3'">Anuais 3º Ano</xsl:when>
87
                                                                <xsl:when test="@id = 'A4'">Anuais 4º Ano</xsl:when>
88
                                                                <xsl:when test="@id = 'A5'">Anuais 5º Ano</xsl:when>
89
                                                                <xsl:otherwise><xsl:value-of select="@id"/></xsl:otherwise>                                                            
90
                                                        </xsl:choose>
91
                                                </th>
92
                                                <xsl:if test="not(./curso:perfil)">
93
                                                        <th class="semestreHead">total</th>
94
                                                        <xsl:if test="//curso:T"><th class="semestreHead">T</th></xsl:if>
95
                                                        <xsl:if test="//curso:TP"><th class="semestreHead">TP</th></xsl:if>                    
96
                                                        <xsl:if test="//curso:P"><th class="semestreHead">P</th></xsl:if>                                                                      
97
                                                        <xsl:if test="//curso:PL"><th class="semestreHead">PL</th></xsl:if>                                                                    
98
                                                        <xsl:if test="//curso:PD"><th class="semestreHead">PD</th></xsl:if>                                                                    
99
                                                        <xsl:if test="//curso:OT"><th class="semestreHead">OT</th></xsl:if>                                                                    
100
                                                        <xsl:if test="//curso:E"><th class="semestreHead">E</th></xsl:if>                                                                      
101
                                                        <xsl:if test="//curso:S"><th class="semestreHead">S</th></xsl:if>                                                                                                                      
102
                                                        <xsl:if test="//curso:TC"><th class="semestreHead">TC</th></xsl:if>                                                                                                            
103
                                                        <xsl:if test="//curso:O"><th class="semestreHead">O</th></xsl:if>                                                                      
104
                                                        <th class="semestreHead ectsHead">ECTS</th>                                                            
105
                                                </xsl:if>                                                                                                                                              
106
                                        </tr>
107
                                        <xsl:choose>
108
                                                <xsl:when test="./curso:perfil">
109
                                                        <xsl:apply-templates select="./curso:perfil" />
110
                                                </xsl:when>
111
                                                <xsl:otherwise>
112
                                                        <xsl:apply-templates select="./curso:unidade" />
113
                                                </xsl:otherwise>
114
                                        </xsl:choose>
115
                                </xsl:for-each>
116
                        </table>
117
                </div>
118
        </xsl:template>
119
        <xsl:template match="curso:perfil">
120
                <tr>
121
                        <th class="perfilNome">
122
                                <xsl:value-of select="@nome"/>
123
                        </th>
124
                        <th class="perfilHead">total</th>
125
                        <xsl:if test="//curso:T"><th class="perfilHead">T</th></xsl:if>
126
                        <xsl:if test="//curso:TP"><th class="perfilHead">TP</th></xsl:if>                      
127
                        <xsl:if test="//curso:P"><th class="perfilHead">P</th></xsl:if>                                                                
128
                        <xsl:if test="//curso:PL"><th class="perfilHead">PL</th></xsl:if>                                                                      
129
                        <xsl:if test="//curso:PD"><th class="perfilHead">PD</th></xsl:if>                                                                      
130
                        <xsl:if test="//curso:OT"><th class="perfilHead">OT</th></xsl:if>                                                                      
131
                        <xsl:if test="//curso:E"><th class="perfilHead">E</th></xsl:if>                                                                
132
                        <xsl:if test="//curso:S"><th class="perfilHead">S</th></xsl:if>                                                                                                                
133
                        <xsl:if test="//curso:TC"><th class="perfilHead">TC</th></xsl:if>                                                                                                              
134
                        <xsl:if test="//curso:O"><th class="perfilHead">O</th></xsl:if>                                                                                                        
135
                        <th class="perfilHead ectsHead">ECTS</th>                                                                                                                      
136
                        <xsl:apply-templates select="./curso:unidade" mode="perfil"/>
137
                </tr>
138
        </xsl:template>
139
        <xsl:template match="curso:unidade" mode="perfil">
140
                <tr>
141
                        <td  class="perfil unidadeNome"><span><xsl:value-of select="./curso:nome"/></span></td>
142
                        <td  class="perfil unidade"><span><xsl:value-of select="./curso:totalHoras"/></span></td>                      
143
                        <xsl:if test="//curso:T"><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></xsl:if>                 
144
                        <xsl:if test="//curso:TP"><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></xsl:if>                      
145
                        <xsl:if test="//curso:P"><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></xsl:if>                 
146
                        <xsl:if test="//curso:PL"><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></xsl:if>                      
147
                        <xsl:if test="//curso:PD"><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></xsl:if>                      
148
                        <xsl:if test="//curso:OT"><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></xsl:if>                      
149
                        <xsl:if test="//curso:E"><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></xsl:if>                 
150
                        <xsl:if test="//curso:S"><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></xsl:if>                 
151
                        <xsl:if test="//curso:TC"><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></xsl:if>                      
152
                        <xsl:if test="//curso:O"><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></xsl:if>                 
153
                        <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>
154
                </tr>
155
        </xsl:template>
156
        <xsl:template match="curso:unidade">
157
                <tr>
158
                        <td  class="unidadeNome"><span><xsl:value-of select="./curso:nome"/></span></td>
159
                        <td  class="unidade"><span><xsl:value-of select="./curso:totalHoras"/></span></td>                     
160
                        <xsl:if test="//curso:T"><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></xsl:if>
161
                        <xsl:if test="//curso:TP"><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></xsl:if>
162
                        <xsl:if test="//curso:P"><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></xsl:if>
163
                        <xsl:if test="//curso:PL"><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></xsl:if>
164
                        <xsl:if test="//curso:PD"><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></xsl:if>
165
                        <xsl:if test="//curso:OT"><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></xsl:if>
166
                        <xsl:if test="//curso:E"><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></xsl:if>
167
                        <xsl:if test="//curso:S"><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></xsl:if>
168
                        <xsl:if test="//curso:TC"><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></xsl:if>
169
                        <xsl:if test="//curso:O"><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></xsl:if>
170
                        <td  class="unidade ects"><span><xsl:if test="./curso:ECTS"><xsl:value-of select="./curso:ECTS"/></xsl:if></span></td>                                                                                                                                                                                                                                                                 
171
                </tr>
172
        </xsl:template>
173
</xsl:stylesheet>