-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathobra.xsl
106 lines (95 loc) · 2.91 KB
/
obra.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.0">
<xsl:template match="obra">
<html>
<body>
<xsl:call-template name="show-meta"/>
<xsl:apply-templates select="instrumentos"/>
<address>[<a href="index.html">Voltar ao menu principal</a>]</address>
</body>
</html>
</xsl:template>
<!-- Instrumentos: ................................................... -->
<xsl:template match="instrumentos">
<h3>Partituras disponíveis:</h3>
<ul>
<xsl:for-each select="instrumento">
<li>
<xsl:value-of select="designacao"/>
<xsl:if test="partitura/@voz">
, <xsl:value-of select="partitura/@voz"/>
</xsl:if>
<xsl:if test="partitura/@clave">
, Clave: <xsl:value-of select="partitura/@clave"/>
</xsl:if>
<xsl:if test="partitura/@afinacao">
, Afinação: <xsl:value-of select="partitura/@afinacao"/>
</xsl:if>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<!-- ...................Mostra a metainformação da obra............... -->
<xsl:template name="show-meta">
<h1>
<xsl:value-of select="titulo"/>
</h1>
<table border="1">
<tr>
<td>Código: </td>
<td><xsl:value-of select="@id"/></td>
</tr>
<tr>
<td>Título: </td>
<td><xsl:value-of select="titulo"/></td>
</tr>
<xsl:if test="subtitulo">
<tr>
<td>Subtítulo: </td>
<td><xsl:value-of select="subtitulo"/></td>
</tr>
</xsl:if>
<xsl:if test="tipo">
<tr>
<td>Tipo/Classe: </td>
<td><xsl:value-of select="tipo"/></td>
</tr>
</xsl:if>
<xsl:if test="desc">
<tr>
<td>Descrição: </td>
<td><xsl:apply-templates select="desc/*"/></td>
</tr>
</xsl:if>
<xsl:if test="compositor">
<tr>
<td>Compositor: </td>
<td><xsl:value-of select="compositor"/></td>
</tr>
</xsl:if>
<xsl:if test="arranjo">
<tr>
<td>Arranjo: </td>
<td><xsl:value-of select="arranjo"/></td>
</tr>
</xsl:if>
<xsl:if test="inf-relacionada">
<tr>
<td>Media: </td>
<td><xsl:apply-templates select="inf-relacionada"/></td>
</tr>
</xsl:if>
</table>
</xsl:template>
<xsl:template match="para">
<p>
<xsl:value-of select="."/>
</p>
</xsl:template>
<!-- ...................Trata os videos................................ -->
<xsl:template match="video">
<iframe width="200" height="150" src="https://www.youtube.com/embed/{substring-after(@href,'v=')}" frameborder="0"
allowfullscreen="1">.</iframe>
</xsl:template>
</xsl:stylesheet>