Project

General

Profile

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

    
3
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
4
                xmlns:crm="http://www.cidoc-crm.org/cidoc-crm/"
5
                xmlns:dr="http://www.driver-repository.eu/namespace/dr"
6
                xmlns:dri="http://www.driver-repository.eu/namespace/dri"
7
                xmlns:dc="http://purl.org/dc/elements/1.1/"
8
                xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
9
                xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
10
                xmlns:foaf="http://xmlns.com/foaf/0.1/">
11

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

    
14
	<xsl:template match="/">
15
		<div class="row">
16
			<div class="col-xs-2">
17
				<img src="../resources/img/record.png" width="80" height="80"/>
18
			</div>
19
			<div class="col-xs-10">
20
				<xsl:if test="//*[local-name()='title']">
21
					<h1 id="overview">
22
						<!-- this is visualized big next to the picture. Since we cannot identify 1 main title, for Parthenos it wil be empty -->
23
						<!--<xsl:value-of select="/crm:P102_has_title"/>-->
24
					</h1>
25
				</xsl:if>
26
			</div>
27
		</div>
28

    
29
		<div class="row">
30
			<div class="col-xs-12">
31
				<h6>
32
					<span class="glyphicon glyphicon-align-left"/>
33
					GENERAL INFORMATION
34
				</h6>
35
				<table class="table">
36
					<tbody>
37
						<tr>
38
							<td class="col-xs-3">
39
								<strong>Original identifier</strong>
40
							</td>
41
							<td>
42
								<xsl:value-of select="//dri:recordIdentifier"/>
43
							</td>
44
						</tr>
45
						<tr>
46
							<td class="col-xs-3">
47
								<strong>Provenance</strong>
48
							</td>
49
							<td>
50
								<i>Data source: </i><xsl:value-of select="//dri:datasourcename"/><br/>
51
								<i>D-Net API: </i><xsl:value-of select="//dri:datasourceapi"/>
52
							</td>
53
						</tr>
54
						<tr>
55
							<td class="col-xs-3">
56
								<strong>Collected</strong>
57
							</td>
58
							<td>
59
								<xsl:value-of select="//dri:dateOfCollection"/>
60
							</td>
61
						</tr>
62
						<tr>
63
							<td class="col-xs-3">
64
								<strong>Transformed</strong>
65
							</td>
66
							<td>
67
								<xsl:value-of select="//dri:dateOfTransformation"/>
68
							</td>
69
						</tr>
70
						<tr>
71
							<td class="col-xs-3">
72
								<strong>Resources (types, labels, and urls)</strong>
73
							</td>
74
							<td>
75
								<xsl:for-each-group select="//rdf:Description" group-by="./rdf:type/@rdf:resource">
76
									<i><xsl:value-of select="tokenize(current-grouping-key(),'/')[last()]"/></i> (<xsl:value-of select="count(current-group())"/>)<br/>
77
										<xsl:for-each select="current-group()">
78
											<xsl:if test="string-length(./rdfs:label) &gt; 0">
79
												- <xsl:value-of select="./rdfs:label"/>
80
												<br/>
81
											</xsl:if>
82
										</xsl:for-each>
83
									<br/>
84
								</xsl:for-each-group>
85
							</td>
86
						</tr>
87
						<tr>
88
							<td class="col-xs-3">
89
								<strong>Notes</strong>
90
							</td>
91
							<td>
92
								<xsl:for-each select="//crm:P3_has_note">
93
									<xsl:value-of select="./text()"/>
94
									<br/>
95
								</xsl:for-each>
96
							</td>
97
						</tr>
98
					</tbody>
99
				</table>
100
			</div>
101
		</div>
102

    
103
		<xsl:for-each select="//*[local-name()='record']">
104
			<h6>
105
				<span class="glyphicon glyphicon-wrench"/>
106
				INDEXED RECORD
107
			</h6>
108
			<xsl:call-template name="xmlItem">
109
				<xsl:with-param name="indent" select="string('')"/>
110
			</xsl:call-template>
111
		</xsl:for-each>
112
	</xsl:template>
113

    
114
	<xsl:template name="xmlAttr">
115
		<span style='color:orange'>
116
			<xsl:value-of select="concat(' ', local-name())"/>
117
		</span>
118
		<xsl:value-of select="concat('=&quot;', ., '&quot;')"/>
119
	</xsl:template>
120

    
121

    
122
	<xsl:template name="xmlItem">
123
		<xsl:param name="indent"/>
124
		<xsl:variable name="tag" select="name()"/>
125
		<xsl:variable name="newindent"><xsl:value-of select="$indent"/>&#160;&#160;&#160;&#160;
126
		</xsl:variable>
127

    
128
		<xsl:if test="string-length($tag)">
129
			<br/>
130
			<xsl:value-of select="$indent"/>
131
			<span style='color:blue'>
132
				<xsl:value-of select="concat('&lt;',$tag)"/>
133
			</span>
134
			<xsl:for-each select="@*">
135
				<xsl:call-template name="xmlAttr"/>
136
			</xsl:for-each>
137
			<xsl:choose>
138
				<xsl:when test="count(child::*) = 0 and count(child::text()) = 1">
139
					<span style='color:blue'>&gt;</span>
140
					<xsl:value-of select="normalize-space(.)"/>
141
					<span style='color:blue'>
142
						<xsl:value-of select="concat('&lt;/',$tag,'&gt;')"/>
143
					</span>
144
				</xsl:when>
145
				<xsl:when test="count(child::* | child::text()) &gt; 0">
146
					<span style='color:blue'>&gt;</span>
147
					<xsl:for-each select="child::* | child::text()">
148
						<xsl:choose>
149
							<xsl:when test="self::text() and string-length(normalize-space(.)) &gt; 0">
150
								<xsl:value-of select="normalize-space(.)"/>
151
							</xsl:when>
152
							<xsl:otherwise>
153
								<xsl:call-template name="xmlItem">
154
									<xsl:with-param name="indent" select="$newindent"/>
155
								</xsl:call-template>
156
							</xsl:otherwise>
157
						</xsl:choose>
158
					</xsl:for-each>
159
					<br/>
160
					<xsl:value-of select="$indent"/>
161
					<span style='color:blue'>
162
						<xsl:value-of select="concat('&lt;/',$tag,'&gt;')"/>
163
					</span>
164
				</xsl:when>
165
				<xsl:otherwise>
166
					<span style='color:blue'>&#160;/&gt;</span>
167
				</xsl:otherwise>
168
			</xsl:choose>
169
		</xsl:if>
170
	</xsl:template>
171

    
172

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