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="recordId"   select="//*[local-name() = 'objIdentifier']" />
12
		<xsl:variable name="type" select="local-name(//*[local-name()='efgEntity']/*)"/>
13
		
14
		<xsl:if test="$type = 'avcreation' or $type = 'avManifestation' or $type = 'nonavcreation' or $type = 'nonAVManifestation'">
15
			<div class="row">
16
				<div class="col-xs-12">
17
					<a class="btn btn-default btn-sm pull-right" href="../ui/patcheditor.do#patch/{$recordId}" >
18
						<span class="glyphicon glyphicon glyphicon-chevron-left"></span> patch
19
					</a>
20
				</div>
21
			</div>
22
		</xsl:if>
23
						
24
		<div class="row">
25
			<div class="col-xs-2">
26
				<img src="../resources/img/record.png" width="80" height="80"/>
27
			</div>
28
			<div class="col-xs-10">
29

    
30
				<xsl:choose>
31
					<xsl:when test=" $type = 'avcreation' or $type = 'nonavcreation' ">
32
						<h1 id="overview">
33
							<xsl:value-of select="//efg:title[1]/efg:text"/>
34
						</h1>
35
					</xsl:when>
36

    
37
					<xsl:when test="$type ='person' or $type ='corporate' or $type ='group' ">
38
						<h1 id="overview">
39
							<xsl:for-each select="//efg:name">
40
								<xsl:value-of select="concat(.,' ')"/>
41
							</xsl:for-each>
42
						</h1>
43
					</xsl:when>
44

    
45

    
46
				</xsl:choose>
47

    
48

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

    
51
				</xsl:if>
52
			</div>
53
		</div>
54

    
55
		
56

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

    
135
							</td>
136
						</tr>
137
						<tr>
138
							<td class="col-xs-3">
139
								<strong>Comment</strong>
140
							</td>
141
							<td>
142
								<xsl:for-each select="//efg:description[@type='comment']">
143
									<xsl:value-of select="."/>
144
									<br/>
145
								</xsl:for-each>
146
							</td>
147
						</tr>
148
						<tr>
149
							<td class="col-xs-3">
150
								<strong>Manifestation</strong>
151
							</td>
152
							<td>
153

    
154
								<xsl:for-each select="//efg:language">
155
									<i>Language:</i>
156
									<b>
157
										<xsl:value-of select="."/>
158
									</b>
159
									<br/>
160
								</xsl:for-each>
161
								<xsl:for-each select="//efg:duration">
162
									<i>Duration:</i>
163
									<b>
164
										<xsl:value-of select="."/>
165
									</b>
166
									<br/>
167
								</xsl:for-each>
168

    
169
							</td>
170
						</tr>
171
					</tbody>
172
				</table>
173
			</div>
174
		</div>
175

    
176
		<xsl:for-each select="//*[local-name()='efgEntity']">
177
			<h6>
178
				<span class="glyphicon glyphicon-wrench"/>
179
				RECORD XML
180
			</h6>
181
			<xsl:call-template name="xmlItem">
182
				<xsl:with-param name="indent" select="string('')"/>
183
			</xsl:call-template>
184
		</xsl:for-each>
185
	</xsl:template>
186

    
187

    
188
	<xsl:template name="xmlAttr">
189
		<span style='color:red'>
190
			<xsl:value-of select="concat(' ', local-name())"/>
191
		</span>
192
		<xsl:value-of select="concat('=&quot;', ., '&quot;')"/>
193
	</xsl:template>
194

    
195
	<xsl:template name="xmlItem">
196
		<xsl:param name="indent"/>
197
		<xsl:variable name="tag" select="local-name()"/>
198
		<xsl:variable name="newindent"><xsl:value-of select="$indent"/>&#160;&#160;&#160;&#160;
199
		</xsl:variable>
200

    
201
		<xsl:if test="string-length($tag)">
202
			<br/>
203
			<xsl:value-of select="$indent"/>
204
			<span style='color:blue'>
205
				<xsl:value-of select="concat('&lt;',$tag)"/>
206
			</span>
207
			<xsl:for-each select="@*">
208
				<xsl:call-template name="xmlAttr"/>
209
			</xsl:for-each>
210

    
211
			<xsl:choose>
212
				<xsl:when test="count(child::*) = 0 and count(child::text()) = 1">
213
					<span style='color:blue'>&gt;</span>
214
					<xsl:value-of select="normalize-space(.)"/>
215
					<span style='color:blue'>
216
						<xsl:value-of select="concat('&lt;/',$tag,'&gt;')"/>
217
					</span>
218
				</xsl:when>
219
				<xsl:when test="count(child::* | child::text()) &gt; 0">
220
					<span style='color:blue'>&gt;</span>
221
					<xsl:for-each select="child::* | child::text()">
222
						<xsl:choose>
223
							<xsl:when test="self::text() and string-length(normalize-space(.)) &gt; 0">
224
								<xsl:value-of select="normalize-space(.)"/>
225
							</xsl:when>
226
							<xsl:otherwise>
227
								<xsl:call-template name="xmlItem">
228
									<xsl:with-param name="indent" select="$newindent"/>
229
								</xsl:call-template>
230
							</xsl:otherwise>
231
						</xsl:choose>
232
					</xsl:for-each>
233
					<br/>
234
					<xsl:value-of select="$indent"/>
235
					<span style='color:blue'>
236
						<xsl:value-of select="concat('&lt;/',$tag,'&gt;')"/>
237
					</span>
238
				</xsl:when>
239
				<xsl:otherwise>
240
					<span style='color:blue'>&#160;/&gt;</span>
241
				</xsl:otherwise>
242
			</xsl:choose>
243
		</xsl:if>
244
	</xsl:template>
245

    
246

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