Project

General

Profile

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

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

    
13
	<xsl:template match="/">
14
		<xsl:variable name="id"   select="//*[local-name() = 'objIdentifier']" />
15

    
16
		<div class="well">
17
			<xsl:if test="//dri:invalid">
18
				<div class="well"><strong>The record contains the following uncleaned fields</strong>
19
					<table class="table table-condensed bg-danger">
20
						<thead>
21
						<tr>
22
							<th>XPath</th><th>Value</th><th>Vocabulary</th>
23
						</tr>
24
						</thead>
25
						<tbody>
26
						<xsl:for-each select="//dri:invalid/dri:error">
27
							<tr>
28
								<td><xsl:value-of select="./@xpath" /></td>
29
								<td><xsl:value-of select="./@term" /></td>
30
								<td><xsl:value-of select="./@vocabularies" /></td>
31
							</tr>
32
						</xsl:for-each>
33
						</tbody>
34
					</table>
35
				</div>
36
			</xsl:if>
37
			<table>
38
				<tr>
39
					<td style="width: 120px">
40
						<img src="../resources/img/record.png" width="80" height="80" />
41
					</td>
42
					<td>
43
						<strong>D-Net identifier: </strong><i><xsl:value-of select="//dri:objIdentifier" /></i><br/>
44
						<strong>Original identifier: </strong>
45
						<xsl:choose>
46
							<xsl:when test="starts-with(//dri:recordIdentifier, 'http')">
47
								<a href="{//dri:recordIdentifier}" target="_blank"><xsl:value-of select="//dri:recordIdentifier"/></a>
48
							</xsl:when>
49
							<xsl:otherwise><xsl:value-of select="//dri:recordIdentifier"/></xsl:otherwise>
50
						</xsl:choose>
51
						<br/>
52
						<strong>Data Source: </strong><i><xsl:value-of select="//dri:datasourcename" /></i><br/>
53
						<strong>Data Source API: </strong><i><xsl:value-of select="//dri:datasourceapi" /></i><br/>
54
						<strong>Resource types: </strong>
55
						<xsl:for-each-group select="//rdf:Description" group-by="./rdf:type/@rdf:resource">
56
							<i><xsl:value-of select="tokenize(current-grouping-key(), '/')[last()]"
57
							/></i> (<xsl:value-of select="count(current-group())"/>) --
58
						</xsl:for-each-group>
59
						<br />
60
						<strong>Notes: </strong><xsl:for-each select="//crm:P3_has_note"><i><xsl:value-of select="." /></i><br/></xsl:for-each><br/>
61
						<br />
62
						<button class="btn btn-primary btn-sm" ng-click="getDocument('objidentifier', '{$id}')">show record</button>
63
					</td>
64
				</tr>
65
			</table>
66
		</div>
67
	</xsl:template>
68

    
69
</xsl:stylesheet>
(2-2/2)