Project

General

Profile

1 295 berkley
<?xml version="1.0"?>
2
<!--
3
  * marine.xsl
4
  *
5
  *      Authors: Matt Jones, Chad Berkley
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 July 20
10
  *    File Info: '$Id$'
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
  * This stylesheet formats .
16
-->
17
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
18
19
  <xsl:output method="html"/>
20
21
  <xsl:template match="/">
22
    <html>
23
      <head>
24
	<link rel="stylesheet" type="text/css" href="/xmltodb/lib/rowcol.css" />
25
      </head>
26
      <body class="emlbody">
27
	<center>
28
          <u><h2>Query Results</h2></u>
29
        </center>
30
31
        <form action="/servlets/marineServlet" 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>Resource Name</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
-->
89
          </td>
90
<!--          <td><xsl:value-of select="./doctype"/>
91
              <xsl:text>&nbsp;</xsl:text>
92
         </td>
93
-->
94
          </tr>
95
        </xsl:for-each>
96
        </table>
97
        </form>
98
99
      </body>
100
    </html>
101
  </xsl:template>
102
103
</xsl:stylesheet>