Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  * resultset.xsl
4
  *
5
  *      Authors: Matt Jones
6
  *    Copyright: 2000 Regents of the University of California and the 
7
  *               National Center for Ecological Analysis and Synthesis
8
  *  For Details: http://www.nceas.ucsb.edu/
9
  *      Created: 2000 April 5
10
  *    File Info: '$Id: resultset.xsl 105 2000-05-20 22:07:38Z jones $'
11
  *
12
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
13
  * convert an XML file showing the resultset of a query
14
  * into an HTML format suitable for rendering with modern web browsers.
15
-->
16
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
17

    
18
  <xsl:output method="html"/>
19

    
20
  <xsl:template match="/">
21
    <html>
22
      <head>
23
	<link rel="stylesheet" type="text/css" href="/xmltodb/rowcol.css" />
24
      </head>
25
      <body class="emlbody">
26
	<center>
27
          <b>Query Results</b>
28
          for query <xsl:value-of select="resultset/query"/>
29
        </center>
30
        
31
        <form action="/servlets/MetaCatServlet" method="POST">
32
        <input type="hidden" name="action" value="getdocument"/>
33

    
34
        <xsl:text>Output Format: </xsl:text>
35
        <select name="qformat">
36
          <option value="html">HTML</option>
37
          <option value="xml">XML</option>
38
        </select>
39

    
40
        <table width="100%">
41
        <tr class="rowodd">
42
        <th>&nbsp;</th>
43
        <th><xsl:text>Title</xsl:text></th>
44
        <th><xsl:text>Document</xsl:text></th>
45
        <th><xsl:text>Document Type</xsl:text></th>
46
        </tr>
47

    
48
        <xsl:for-each select="resultset/document">
49
          <tr valign="top">
50
            <xsl:attribute name="class">
51
              <xsl:choose>
52
                <xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>
53
                <xsl:when test="position() mod 2 = 0">rowlight</xsl:when>
54
              </xsl:choose>
55
            </xsl:attribute>
56

    
57
          <td>
58
<!--
59
              <input type="radio" name="docid">
60
                <xsl:attribute name="value">
61
                  <xsl:value-of select="./docid"/>
62
                </xsl:attribute>
63
              </input>
64
              <input type="submit" value="Display"/>
65
-->
66
              <input border="0" type="image">
67
                <xsl:attribute name="src">
68
                  <xsl:choose>
69
                    <xsl:when test="position() 
70
                         mod 2 = 1">/xmltodb/images/bttns-white.png</xsl:when>
71
                    <xsl:when test="position() 
72
                         mod 2 = 0">/xmltodb/images/bttns-blue.jpg</xsl:when>
73
                  </xsl:choose>
74
                </xsl:attribute>
75
                <xsl:attribute name="name">
76
                  <xsl:value-of select="./docid"/>
77
                </xsl:attribute>
78
              </input>
79
          </td>
80
          <td><xsl:value-of select="./doctitle"/>
81
              <xsl:text>&nbsp;</xsl:text>
82
         </td>
83
          <td>
84
              <xsl:value-of select="./docname"/> 
85
              <xsl:text> </xsl:text>
86
              <xsl:value-of select="./docid"/>
87
              <xsl:text>&nbsp;</xsl:text>
88
          </td>
89
          <td><xsl:value-of select="./doctype"/>
90
              <xsl:text>&nbsp;</xsl:text>
91
         </td>
92
          </tr>
93
        </xsl:for-each>
94
        </table>
95
        </form>
96

    
97
      </body>
98
    </html>
99
  </xsl:template>
100

    
101
</xsl:stylesheet>
(7-7/9)