Project

General

Profile

1
<?xml version="1.0" encoding="UTF-8"?>
2

    
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
                xmlns:efg="http://www.europeanfilmgateway.eu/efg"
5
                version="2.0"
6
>
7

    
8
	<xsl:output method="html" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
9

    
10
	<xsl:template match="/">
11
		<xsl:variable name="type" select="local-name(//*[local-name()='efgEntity']/*)"/>
12
		<div class="row">
13
			<div class="col-xs-2">
14
				<img src="../resources/img/record.png" width="80" height="80"/>
15
			</div>
16
			<div class="col-xs-10">
17

    
18
				<xsl:choose>
19
					<xsl:when test=" $type = 'avcreation' or $type = 'nonavcreation' ">
20
						<h1 id="overview">
21
							<xsl:value-of select="//efg:title[1]/efg:text"/>
22
						</h1>
23
					</xsl:when>
24

    
25
					<xsl:when test="$type ='person' or $type ='corporate' or $type ='group' ">
26
						<h1 id="overview">
27
							<xsl:for-each select="//efg:name">
28
								<xsl:value-of select="concat(.,' ')"/>
29
							</xsl:for-each>
30
						</h1>
31
					</xsl:when>
32

    
33

    
34
				</xsl:choose>
35

    
36

    
37
				<xsl:if test="//*[local-name()='title']">
38

    
39
				</xsl:if>
40
			</div>
41
		</div>
42

    
43
		<div class="row">
44
			<div class="col-xs-12">
45
				<h6>
46
					<span class="glyphicon glyphicon-align-left"/>
47
					GENERAL INFORMATION
48
				</h6>
49
				<table class="table">
50
					<tbody>
51
						<tr>
52
							<td class="col-xs-3">
53
								<strong>Identifier</strong>
54
							</td>
55
							<td>
56
								<xsl:for-each select="//efg:sourceID">
57
									-
58
									<xsl:value-of select="."/>
59
									<br/>
60
								</xsl:for-each>
61
							</td>
62
						</tr>
63
						<tr>
64
							<td class="col-xs-3">
65
								<strong>Genre</strong>
66
							</td>
67
							<td>
68
								<xsl:for-each select="//efg:keywords[@type='genre']/efg:term">
69
									<xsl:value-of select="."/>
70
									<br/>
71
								</xsl:for-each>
72
							</td>
73
						</tr>
74
						<tr>
75
							<td class="col-xs-3">
76
								<strong>Synopsis</strong>
77
							</td>
78
							<td>
79
								<xsl:for-each select="//efg:description[@type='synopsis']">
80
									<xsl:value-of select="."/>
81
									<br/>
82
								</xsl:for-each>
83
							</td>
84
						</tr>
85
						<tr>
86
							<td class="col-xs-3">
87
								<strong>Subjects</strong>
88
							</td>
89
							<td>
90
								<xsl:for-each select="//efg:keywords[@type='Subject']/efg:term">
91
									<xsl:value-of select="."/>
92
									<br/>
93
								</xsl:for-each>
94
							</td>
95
						</tr>
96
						<tr>
97
							<td class="col-xs-3">
98
								<strong>Type</strong>
99
							</td>
100
							<td>
101
								<xsl:for-each select="local-name(//efg:efgEntity/*)">
102
									<xsl:value-of select="."/>
103
									<br/>
104
								</xsl:for-each>
105
							</td>
106
						</tr>
107
						<tr>
108
							<td class="col-xs-3">
109
								<strong>Archive</strong>
110
							</td>
111
							<td>
112
								<xsl:for-each select="//efg:provider">
113
									<xsl:if test="position()=1">
114
										<xsl:value-of select="."/>
115
									</xsl:if>
116
								</xsl:for-each>
117
								<br/>
118

    
119
							</td>
120
						</tr>
121
						<tr>
122
							<td class="col-xs-3">
123
								<strong>Comment</strong>
124
							</td>
125
							<td>
126
								<xsl:for-each select="//efg:description[@type='comment']">
127
									<xsl:value-of select="."/>
128
									<br/>
129
								</xsl:for-each>
130
							</td>
131
						</tr>
132
						<tr>
133
							<td class="col-xs-3">
134
								<strong>Manifestation</strong>
135
							</td>
136
							<td>
137

    
138
								<xsl:for-each select="//efg:language">
139
									<i>Language:</i>
140
									<b>
141
										<xsl:value-of select="."/>
142
									</b>
143
									<br/>
144
								</xsl:for-each>
145
								<xsl:for-each select="//efg:duration">
146
									<i>Duration:</i>
147
									<b>
148
										<xsl:value-of select="."/>
149
									</b>
150
									<br/>
151
								</xsl:for-each>
152

    
153
							</td>
154
						</tr>
155
					</tbody>
156
				</table>
157
			</div>
158
		</div>
159

    
160
		<xsl:for-each select="//*[local-name()='efgEntity']">
161
			<h6>
162
				<span class="glyphicon glyphicon-wrench"/>
163
				RECORD XML
164
			</h6>
165
			<xsl:call-template name="xmlItem">
166
				<xsl:with-param name="indent" select="string('')"/>
167
			</xsl:call-template>
168
		</xsl:for-each>
169
	</xsl:template>
170

    
171

    
172
	<xsl:template name="xmlAttr">
173
		<span style='color:red'>
174
			<xsl:value-of select="concat(' ', local-name())"/>
175
		</span>
176
		<xsl:value-of select="concat('=&quot;', ., '&quot;')"/>
177
	</xsl:template>
178

    
179
	<xsl:template name="xmlItem">
180
		<xsl:param name="indent"/>
181
		<xsl:variable name="tag" select="local-name()"/>
182
		<xsl:variable name="newindent"><xsl:value-of select="$indent"/>&#160;&#160;&#160;&#160;
183
		</xsl:variable>
184

    
185
		<xsl:if test="string-length($tag)">
186
			<br/>
187
			<xsl:value-of select="$indent"/>
188
			<span style='color:blue'>
189
				<xsl:value-of select="concat('&lt;',$tag)"/>
190
			</span>
191
			<xsl:for-each select="@*">
192
				<xsl:call-template name="xmlAttr"/>
193
			</xsl:for-each>
194

    
195
			<xsl:choose>
196
				<xsl:when test="count(child::*) = 0 and count(child::text()) = 1">
197
					<span style='color:blue'>&gt;</span>
198
					<xsl:value-of select="normalize-space(.)"/>
199
					<span style='color:blue'>
200
						<xsl:value-of select="concat('&lt;/',$tag,'&gt;')"/>
201
					</span>
202
				</xsl:when>
203
				<xsl:when test="count(child::* | child::text()) &gt; 0">
204
					<span style='color:blue'>&gt;</span>
205
					<xsl:for-each select="child::* | child::text()">
206
						<xsl:choose>
207
							<xsl:when test="self::text() and string-length(normalize-space(.)) &gt; 0">
208
								<xsl:value-of select="normalize-space(.)"/>
209
							</xsl:when>
210
							<xsl:otherwise>
211
								<xsl:call-template name="xmlItem">
212
									<xsl:with-param name="indent" select="$newindent"/>
213
								</xsl:call-template>
214
							</xsl:otherwise>
215
						</xsl:choose>
216
					</xsl:for-each>
217
					<br/>
218
					<xsl:value-of select="$indent"/>
219
					<span style='color:blue'>
220
						<xsl:value-of select="concat('&lt;/',$tag,'&gt;')"/>
221
					</span>
222
				</xsl:when>
223
				<xsl:otherwise>
224
					<span style='color:blue'>&#160;/&gt;</span>
225
				</xsl:otherwise>
226
			</xsl:choose>
227
		</xsl:if>
228
	</xsl:template>
229

    
230

    
231
</xsl:stylesheet>
(1-1/2)