Project

General

Profile

1 1929 brooke
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matt Jones, CHad Berkley
5
  *    Copyright: 2000 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *
9
  *   '$Author$'
10
  *     '$Date$'
11
  * '$Revision$'
12
  *
13
  * This program is free software; you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License as published by
15
  * the Free Software Foundation; either version 2 of the License, or
16
  * (at your option) any later version.
17
  *
18
  * This program is distributed in the hope that it will be useful,
19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
  * GNU General Public License for more details.
22
  *
23
  * You should have received a copy of the GNU General Public License
24
  * along with this program; if not, write to the Free Software
25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
  *
27
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
28
  * convert an XML file showing the resultset of a query
29
  * into an HTML format suitable for rendering with modern web browsers.
30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
32
  <xsl:output method="html"/>
33
  <xsl:param name="qformat">default</xsl:param>
34
  <xsl:template match="/">
35
    <html>
36
      <head>
37
        <link rel="stylesheet" type="text/css"
38
              href="@style-skins-path@/{$qformat}/{$qformat}.css" />
39
      </head>
40
41
      <body>
42
        <table width="100%">
43
          <tr>
44
            <td rowspan="2"><img src="@web-base-url@/images/KNBLogo.gif"/></td>
45
            <td colspan="7"><div class="title">Biocomplexity Data Search</div>
46
            </td>
47
          </tr>
48
          <tr>
49
            <td><a href="@web-base-url@" class="toollink"> KNB </a></td>
50
            <td><a href="@web-base-url@/data.html" class="toollink">
51
                Data </a></td>
52
            <td><a href="@web-base-url@/people.html" class="toollink">
53
                People </a></td>
54
            <td><a href="@web-base-url@/informatics" class="toollink">
55
                Informatics </a></td>
56
            <td><a href="@web-base-url@/biodiversity" class="toollink">
57
                Biodiversity </a></td>
58
            <td><a href="@web-base-url@/education" class="toollink">
59
                Education </a></td>
60
            <td><a href="@web-base-url@/software" class="toollink">
61
                Software </a></td>
62
         </tr>
63
         <tr>
64
          <td align="right" valign="top" colspan="7">
65
            <form action="@servlet-path@" method="POST">
66
             Data Search: <input type="text" name="anyfield" size="10" />
67
             <input type="hidden" name="action" value="query" />
68
             <input type="hidden" name="qformat" value="knb" />
69
             <input type="hidden" name="operator" value="UNION" />
70
71
             <input type="hidden" name="returnfield"
72
              value="creator/individualName/surName" />
73
             <input type="hidden" name="returnfield"
74
              value="creator/organizationName" />
75
             <input type="hidden" name="returnfield"
76
              value="originator/individualName/surName" />
77
             <input type="hidden" name="returnfield"
78
              value="originator/individualName/givenName" />
79
             <input type="hidden" name="returnfield"
80
              value="originator/organizationName" />
81
             <input type="hidden" name="returnfield"
82
              value="dataset/title" />
83
             <input type="hidden" name="returnfield"
84
              value="keyword" />
85
             <input type="hidden" name="returndoctype"
86
              value="eml://ecoinformatics.org/eml-2.0.0" />
87
             <input type="hidden" name="returndoctype"
88
              value="-//NCEAS//eml-dataset-2.0//EN" />
89
             <input type="hidden" name="returndoctype"
90
              value="-//NCEAS//resource//EN" />
91
             <input type="hidden" name="returndoctype"
92
              value="-//NCEAS//eml-dataset//EN" />
93
              <input type="hidden" name="returndoctype"
94
              value="-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN" />
95
              <input type="hidden" name="returndoctype"
96
              value="-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN" />
97
           </form>
98
          </td>
99
        </tr>
100
       </table>
101
102
       <p><xsl:number value="count(resultset/document)" /> documents found.</p>
103
       <!-- This tests to see if there are returned documents,
104
            if there are not then don't show the query results -->
105
       <xsl:if test="count(resultset/document) &gt; 0">
106
           <table border="0" cellpadding="2" cellspacing="2">
107
           <tr valign="top">
108
           <td width="33%">
109
           <h3>Browse data sets by keyword:</h3>
110
           <ul>
111
               <xsl:apply-templates select="//param[@name='keyword' and not(. = preceding::param) and not(normalize-space(.) = '')]">
112
                   <xsl:sort select="."/>
113
               </xsl:apply-templates>
114
           </ul>
115
           </td>
116
           <td width="33%">
117
           <h3>Browse data sets by creator:</h3>
118
           <ul>
119
               <xsl:apply-templates select="//param[@name='surName' and not(. = preceding::param) and not(normalize-space(.) = '')]">
120
                   <xsl:sort select="."/>
121
               </xsl:apply-templates>
122
           </ul>
123
           </td>
124
           <td width="33%">
125
           <h3>Browse data sets by organization:</h3>
126
           <ul>
127
               <xsl:apply-templates select="//param[@name='organizationName' and not(. = preceding::param) and not(normalize-space(.) = '')]">
128
                   <xsl:sort select="."/>
129
               </xsl:apply-templates>
130
           </ul>
131
           </td>
132
           </tr>
133
           </table>
134
       </xsl:if>
135
      </body>
136
    </html>
137
  </xsl:template>
138
139
  <xsl:template match="param[@name='keyword']">
140
     <li>
141
     <a>
142
       <xsl:attribute name="href">@servlet-path@?action=query&amp;operator=INTERSECT&amp;qformat=knb&amp;returndoctype=eml://ecoinformatics.org/eml-2.0.0&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN&amp;returnfield=dataset/title&amp;returnfield=citation/title&amp;returnfield=software/title&amp;returnfield=protocol/title&amp;returnfield=keyword&amp;returnfield=originator/individualName/surName&amp;returnfield=creator/individualName/surName&amp;returnfield=originator/organizationName&amp;returnfield=creator/organizationName&amp;keyword=<xsl:value-of select="."/></xsl:attribute>
143
     <xsl:value-of select="."/>
144
     </a> (<xsl:value-of select="count(//param[.=current()])"/>)
145
     </li>
146
  </xsl:template>
147
148
  <xsl:template match="param[@name='surName']">
149
     <li>
150
     <a>
151
       <xsl:attribute name="href">@servlet-path@?action=query&amp;operator=INTERSECT&amp;qformat=knb&amp;returndoctype=eml://ecoinformatics.org/eml-2.0.0&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN&amp;returnfield=dataset/title&amp;returnfield=citation/title&amp;returnfield=software/title&amp;returnfield=protocol/title&amp;returnfield=keyword&amp;returnfield=originator/individualName/surName&amp;returnfield=creator/individualName/surName&amp;returnfield=originator/organizationName&amp;returnfield=creator/organizationName&amp;surName=<xsl:value-of select="."/></xsl:attribute>
152
     <xsl:value-of select="."/>
153
     </a> (<xsl:value-of select="count(//param[.=current()])"/>)
154
     </li>
155
  </xsl:template>
156
157
  <xsl:template match="param[@name='organizationName']">
158
     <li>
159
     <a>
160
       <xsl:attribute name="href">@servlet-path@?action=query&amp;operator=INTERSECT&amp;qformat=knb&amp;returndoctype=eml://ecoinformatics.org/eml-2.0.0&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN&amp;returnfield=dataset/title&amp;returnfield=citation/title&amp;returnfield=software/title&amp;returnfield=protocol/title&amp;returnfield=keyword&amp;returnfield=originator/individualName/surName&amp;returnfield=creator/individualName/surName&amp;returnfield=originator/organizationName&amp;returnfield=creator/organizationName&amp;organizationName=<xsl:value-of select="."/></xsl:attribute>
161
     <xsl:value-of select="."/>
162
     </a> (<xsl:value-of select="count(//param[.=current()])"/>)
163
     </li>
164
  </xsl:template>
165
166
</xsl:stylesheet>