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

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

    
96
</xsl:stylesheet>
(14-14/14)