Project

General

Profile

1 4005 berkley
<?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 4014 berkley
    <table width="100%">
6
      <tr>
7
        <th>
8
          Document ID
9
        </th>
10
        <th>
11
          &#160;
12
        </th>
13
        <th>
14
          Title
15
        </th>
16
        <th>
17
          Document Type
18
        </th>
19
      </tr>
20 4005 berkley
      <xsl:apply-templates select="//document"/>
21
    </table>
22 4014 berkley
23 4012 berkley
    <!-- page navigation-->
24 4005 berkley
    <div class="resultnavbar">
25
      <!--previous-->
26
      <xsl:choose>
27
        <xsl:when test="//pagestart = 0">
28 4012 berkley
          &#8592; previous
29 4005 berkley
        </xsl:when>
30
        <xsl:otherwise>
31
          <a>
32
            <xsl:attribute name="href">
33 4014 berkley
              javascript:reloadSearchContent('/sms/metacat?action=query&amp;anytext=%25&amp;qformat=sms&amp;returnfield=dataset/title&amp;pagesize=10&amp;pagestart=<xsl:value-of select="//previouspage"/>');
34 4005 berkley
            </xsl:attribute>
35 4012 berkley
              &#8592; previous
36 4005 berkley
          </a>
37
        </xsl:otherwise>
38
      </xsl:choose>
39 4012 berkley
40
      &#160; &#160;
41 4005 berkley
42
      <!--next-->
43
      <xsl:choose>
44
        <xsl:when test="//lastpage = 'true'">
45 4012 berkley
          next &#8594;
46 4005 berkley
        </xsl:when>
47
        <xsl:otherwise>
48
          <a>
49
          <xsl:attribute name="href">
50 4014 berkley
            javascript:reloadSearchContent('/sms/metacat?action=query&amp;anytext=%25&amp;qformat=sms&amp;returnfield=dataset/title&amp;pagesize=10&amp;pagestart=<xsl:value-of select="//nextpage"/>');
51 4005 berkley
          </xsl:attribute>
52 4012 berkley
            next &#8594;
53 4005 berkley
          </a>
54
        </xsl:otherwise>
55
      </xsl:choose>
56
    </div>
57
  </xsl:template>
58
59 4012 berkley
  <!--search results-->
60 4005 berkley
  <xsl:template match="document">
61
    <tr>
62
      <td>
63 4014 berkley
        <a><!--docid-->
64 4005 berkley
        <xsl:attribute name="href">
65
          /sms/metacat?action=read&amp;qformat=sms&amp;docid=<xsl:value-of select="docid"/>
66
        </xsl:attribute>
67
        <xsl:value-of select="docid"/>
68
        </a>
69
      </td>
70 4014 berkley
      <td><!--xml link-->
71
        <a>
72
          <xsl:attribute name="href">
73
            /sms/metacat?action=read&amp;qformat=xml&amp;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 4005 berkley
        <xsl:choose>
80 4014 berkley
          <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 4005 berkley
        <xsl:when test="doctype='eml://ecoinformatics.org/eml-2.0.1'">
91
          EML 2.0.1 Document
92
        </xsl:when>
93 4012 berkley
        <xsl:when test="doctype='rdf:RDF'">
94
          RDF Ontology
95
        </xsl:when>
96
        <!--add more doctypes here-->
97 4005 berkley
        <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>