Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
*  '$RCSfile: searchbox.xsl,v $'
4
*      Authors: Chris Jones
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: cjones $'
10
*     '$Date: 2004/10/05 23:50:46 $'
11
* '$Revision: 1.1 $'
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 
32
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" 
33
  xmlns:url="http://www.jclark.com/xt/java/java.net.URLEncoder" exclude-result-prefixes="url">
34
  
35
  <!-- This parameter gets overidden by the chosen default qformat -->
36
  <xsl:param name="qformat">default</xsl:param>
37
  <xsl:param name="servletURL"/>
38

    
39
  <xsl:output method="html" encoding="iso-8859-1" indent="yes" standalone="yes"
40
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
41
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
42
    
43
  <xsl:template name="searchbox">
44
    <!-- begin search form area -->
45
    <xsl:comment>begin the search form area</xsl:comment>
46
    <div id="search-box">
47
      <table class="group group_border">
48
        <tr>
49
          <th>
50
            Show all Datasets:
51
          </th> 
52
          <th>
53
            Search by Keyword:
54
          </th>
55
        </tr>
56
        <tr>
57
          <td>           
58
   
59

    
60
         
61
      
62
          <xsl:variable name="my_query"><![CDATA[<?xml version="1.0"?>
63
             <pathquery version="1.2">
64
              <returndoctype>eml://ecoinformatics.org/eml-2.1.0</returndoctype>
65
              <returndoctype>eml://ecoinformatics.org/eml-2.0.1</returndoctype>
66
              <returndoctype>eml://ecoinformatics.org/eml-2.0.0</returndoctype>
67
              <returnfield>eml/dataset/title</returnfield>
68
              <returnfield>eml/dataset/dataTable/entityName</returnfield>
69
              <returnfield>eml/dataset/creator/individualName/surName</returnfield>
70
              <returnfield>eml/dataset/creator/organizationName</returnfield>
71
              <returnfield>eml/dataset/dataTable/physical/distribution/online/url</returnfield>
72
              <querygroup operator="INTERSECT">
73
                <queryterm casesensitive="false" searchmode="starts-with">
74
                  <value>SBCLTER:</value>
75
                  <pathexpr>eml/dataset/title</pathexpr>
76
                </queryterm>
77
                <queryterm casesensitive="false" searchmode="equals">
78
                  <value>public</value>
79
                  <pathexpr>eml/dataset/access/allow/principal</pathexpr>
80
                </queryterm>
81
              </querygroup>
82
            </pathquery>]]>   <!-- end of cdata query -->
83
          </xsl:variable>
84
          <xsl:if test="function-available('url:encode')">
85
            <a href="{$servletURL}?action=squery&amp;qformat=sbclter&amp;query={url:encode($my_query)}">
86
              <xsl:text>All SBCLTER Data Packages </xsl:text> 
87
            </a>
88
          </xsl:if>         
89
        </td>
90
        <td>
91
          <em>Keyword Search not yet available</em>
92
        </td>
93
      </tr>
94
    </table>
95
  </div>
96
  <xsl:comment>end the search form area</xsl:comment>
97
  <!-- end search form area -->
98
  
99
</xsl:template>
100

    
101
</xsl:stylesheet>
(10-10/10)