Project

General

Profile

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

    
75
</xsl:stylesheet>
(5-5/13)