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 4076 berkley
              <xsl:if test="/resultset/query/pathquery/querygroup/queryterm/value!='%'">
34
                javascript:reloadSearchContent('/sms/metacat?action=query&amp;anyfield=<xsl:value-of select="/resultset/query/pathquery/querygroup/queryterm/value"/>&amp;qformat=sms&amp;returnfield=dataset/title&amp;pagesize=10&amp;pagestart=<xsl:value-of select="//previouspage"/>');
35
              </xsl:if>
36
              <xsl:if test="/resultset/query/pathquery/querygroup/queryterm/value='%'">
37
                javascript:reloadSearchContent('/sms/metacat?action=query&amp;anyfield=<xsl:value-of select="'%25'"/><xsl:value-of select="'25'"/>&amp;qformat=sms&amp;returnfield=dataset/title&amp;pagesize=10&amp;pagestart=<xsl:value-of select="//previouspage"/>');
38
              </xsl:if>
39 4005 berkley
            </xsl:attribute>
40 4012 berkley
              &#8592; previous
41 4005 berkley
          </a>
42
        </xsl:otherwise>
43
      </xsl:choose>
44 4012 berkley
45
      &#160; &#160;
46 4005 berkley
47
      <!--next-->
48
      <xsl:choose>
49
        <xsl:when test="//lastpage = 'true'">
50 4012 berkley
          next &#8594;
51 4005 berkley
        </xsl:when>
52
        <xsl:otherwise>
53
          <a>
54
          <xsl:attribute name="href">
55 4076 berkley
            <xsl:choose>
56
            <xsl:when test="/resultset/query/pathquery/querygroup/queryterm/value!='%'">
57
              javascript:reloadSearchContent('/sms/metacat?action=query&amp;anyfield=<xsl:value-of select="/resultset/query/pathquery/querygroup/queryterm/value"/>&amp;qformat=sms&amp;returnfield=dataset/title&amp;pagesize=10&amp;pagestart=<xsl:value-of select="//nextpage"/>');
58
            </xsl:when>
59
            <xsl:when test="/resultset/query/pathquery/querygroup/queryterm/value='%'">
60
              javascript:reloadSearchContent('/sms/metacat?action=query&amp;anyfield=<xsl:value-of select="'%25'"/><xsl:value-of select="'25'"/>&amp;qformat=sms&amp;returnfield=dataset/title&amp;pagesize=10&amp;pagestart=<xsl:value-of select="//nextpage"/>');
61
            </xsl:when>
62
            </xsl:choose>
63
64 4005 berkley
          </xsl:attribute>
65 4012 berkley
            next &#8594;
66 4005 berkley
          </a>
67
        </xsl:otherwise>
68
      </xsl:choose>
69
    </div>
70
  </xsl:template>
71
72 4012 berkley
  <!--search results-->
73 4005 berkley
  <xsl:template match="document">
74
    <tr>
75
      <td>
76 4014 berkley
        <a><!--docid-->
77 4005 berkley
        <xsl:attribute name="href">
78
          /sms/metacat?action=read&amp;qformat=sms&amp;docid=<xsl:value-of select="docid"/>
79
        </xsl:attribute>
80
        <xsl:value-of select="docid"/>
81
        </a>
82
      </td>
83 4014 berkley
      <td><!--xml link-->
84
        <a>
85
          <xsl:attribute name="href">
86
            /sms/metacat?action=read&amp;qformat=xml&amp;docid=<xsl:value-of select="docid"/>
87
          </xsl:attribute>
88
          <img width="25px" src="style/skins/sms/xml-button.png"/>
89
        </a>
90
      </td>
91
      <td> <!--title of the doc if it's eml-->
92 4005 berkley
        <xsl:choose>
93 4014 berkley
          <xsl:when test="param[@name='dataset/title'] != ''">
94
            <xsl:value-of select="param[@name='dataset/title']"/>
95
          </xsl:when>
96
          <xsl:otherwise>
97
            No Title
98
          </xsl:otherwise>
99
        </xsl:choose>
100
      </td>
101
      <td><!--doc type-->
102
        <xsl:choose>
103 4005 berkley
        <xsl:when test="doctype='eml://ecoinformatics.org/eml-2.0.1'">
104
          EML 2.0.1 Document
105
        </xsl:when>
106 4012 berkley
        <xsl:when test="doctype='rdf:RDF'">
107
          RDF Ontology
108
        </xsl:when>
109 4046 berkley
        <xsl:when test="doctype='http://daks.ucdavis.edu/sms-annot-1.0.0rc1'">
110
          SMS Annotation
111
        </xsl:when>
112 4012 berkley
        <!--add more doctypes here-->
113 4005 berkley
        <xsl:otherwise>
114 4046 berkley
          <xsl:value-of select="doctype"/>
115 4005 berkley
        </xsl:otherwise>
116
        </xsl:choose>
117
      </td>
118
    </tr>
119
  </xsl:template>
120
121
122
123
124
</xsl:stylesheet>