1
|
<?xml version="1.0"?>
|
2
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
|
3
|
|
4
|
<xsl:template match="/">
|
5
|
<table width="100%">
|
6
|
<tr>
|
7
|
<th>
|
8
|
Document ID
|
9
|
</th>
|
10
|
<th>
|
11
|
 
|
12
|
</th>
|
13
|
<th>
|
14
|
Title
|
15
|
</th>
|
16
|
<th>
|
17
|
Document Type
|
18
|
</th>
|
19
|
</tr>
|
20
|
<xsl:apply-templates select="//document"/>
|
21
|
</table>
|
22
|
|
23
|
<!-- page navigation-->
|
24
|
<div class="resultnavbar">
|
25
|
<!--previous-->
|
26
|
<xsl:choose>
|
27
|
<xsl:when test="//pagestart = 0">
|
28
|
← previous
|
29
|
</xsl:when>
|
30
|
<xsl:otherwise>
|
31
|
<a>
|
32
|
<xsl:attribute name="href">
|
33
|
javascript:reloadSearchContent('/sms/metacat?action=query&anytext=%25&qformat=sms&returnfield=dataset/title&pagesize=10&pagestart=<xsl:value-of select="//previouspage"/>');
|
34
|
</xsl:attribute>
|
35
|
← previous
|
36
|
</a>
|
37
|
</xsl:otherwise>
|
38
|
</xsl:choose>
|
39
|
|
40
|
   
|
41
|
|
42
|
<!--next-->
|
43
|
<xsl:choose>
|
44
|
<xsl:when test="//lastpage = 'true'">
|
45
|
next →
|
46
|
</xsl:when>
|
47
|
<xsl:otherwise>
|
48
|
<a>
|
49
|
<xsl:attribute name="href">
|
50
|
javascript:reloadSearchContent('/sms/metacat?action=query&anytext=%25&qformat=sms&returnfield=dataset/title&pagesize=10&pagestart=<xsl:value-of select="//nextpage"/>');
|
51
|
</xsl:attribute>
|
52
|
next →
|
53
|
</a>
|
54
|
</xsl:otherwise>
|
55
|
</xsl:choose>
|
56
|
</div>
|
57
|
</xsl:template>
|
58
|
|
59
|
<!--search results-->
|
60
|
<xsl:template match="document">
|
61
|
<tr>
|
62
|
<td>
|
63
|
<a><!--docid-->
|
64
|
<xsl:attribute name="href">
|
65
|
/sms/metacat?action=read&qformat=sms&docid=<xsl:value-of select="docid"/>
|
66
|
</xsl:attribute>
|
67
|
<xsl:value-of select="docid"/>
|
68
|
</a>
|
69
|
</td>
|
70
|
<td><!--xml link-->
|
71
|
<a>
|
72
|
<xsl:attribute name="href">
|
73
|
/sms/metacat?action=read&qformat=xml&docid=<xsl:value-of select="docid"/>
|
74
|
</xsl:attribute>
|
75
|
<img width="25px" src="style/skins/sms/xml-button.png"/>
|
76
|
</a>
|
77
|
</td>
|
78
|
<td> <!--title of the doc if it's eml-->
|
79
|
<xsl:choose>
|
80
|
<xsl:when test="param[@name='dataset/title'] != ''">
|
81
|
<xsl:value-of select="param[@name='dataset/title']"/>
|
82
|
</xsl:when>
|
83
|
<xsl:otherwise>
|
84
|
No Title
|
85
|
</xsl:otherwise>
|
86
|
</xsl:choose>
|
87
|
</td>
|
88
|
<td><!--doc type-->
|
89
|
<xsl:choose>
|
90
|
<xsl:when test="doctype='eml://ecoinformatics.org/eml-2.0.1'">
|
91
|
EML 2.0.1 Document
|
92
|
</xsl:when>
|
93
|
<xsl:when test="doctype='rdf:RDF'">
|
94
|
RDF Ontology
|
95
|
</xsl:when>
|
96
|
<!--add more doctypes here-->
|
97
|
<xsl:otherwise>
|
98
|
Unknown Document Type
|
99
|
</xsl:otherwise>
|
100
|
</xsl:choose>
|
101
|
</td>
|
102
|
</tr>
|
103
|
</xsl:template>
|
104
|
|
105
|
|
106
|
|
107
|
|
108
|
</xsl:stylesheet>
|