Project

General

Profile

1
<?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: marine.xsl 298 2000-07-26 22:26:13Z berkley $'
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
      
28
      	<form action="http://alpha.nceas.ucsb.edu/servlets/marineServlet" 
29
              method="POST"> 
30
           <table width="100%">
31
             <tr>
32
                <td>First Name:</td>
33
                <td>Organization:</td>
34
                <td>Address:</td>
35
                <td>Postal Code:</td>
36
             </tr>
37
             <tr>
38
             	<td><input type="text" name="given_name"></td>
39
             	<td><input type="text" name="organization"></td>
40
             	<td><input type="text" name="deliveryPoint"></td>
41
             	<td><input type="text" name="postalCode"></td>
42
             </td>
43
             <tr>
44
             	<td>Last Name:</td>
45
             	<td>Email Address:</td>
46
             	<td>City:</td>
47
             	<td>Phone:</td>
48
             </tr>
49
             <tr>
50
             	<td><input type="text" name="surname"></td>
51
             	<td><input type="text" name="electronicMailAddress></td>
52
             	<td><input type="text" name="city"></td>
53
             	<td><input type="text" name="voice"></td>
54
             </tr>
55
           
56
        </form>
57
      
58
	<center>
59
          <u><h2>Query Results</h2></u>
60
        </center>
61
        
62
        <form action="/servlets/marineServlet" method="POST">
63
        <input type="hidden" name="action" value="getdocument"/>
64

    
65
        <xsl:text>Output Format: </xsl:text>
66
        <select name="qformat">
67
          <option value="html">HTML</option>
68
          <option value="xml">XML</option>
69
        </select>
70

    
71
        <table width="100%">
72
        <tr class="rowodd">
73
        <th>&nbsp;</th>
74
        <th><xsl:text>Title</xsl:text></th>
75
        <th><xsl:text>Resource Name</xsl:text></th>
76
<!--        <th><xsl:text>Document Type</xsl:text></th> -->
77
        </tr>
78

    
79
        <xsl:for-each select="resultset/document">
80
          <tr valign="top">
81
            <xsl:attribute name="class">
82
              <xsl:choose>
83
                <xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>
84
                <xsl:when test="position() mod 2 = 0">rowlight</xsl:when>
85
              </xsl:choose>
86
            </xsl:attribute>
87

    
88
          <td>
89
<!--
90
              <input type="radio" name="docid">
91
                <xsl:attribute name="value">
92
                  <xsl:value-of select="./docid"/>
93
                </xsl:attribute>
94
              </input>
95
              <input type="submit" value="Display"/>
96
-->
97
              <input border="0" type="image">
98
                <xsl:attribute name="src">
99
                  <xsl:choose>
100
                    <xsl:when test="position() 
101
                         mod 2 = 1">/xmltodb/images/bttns-white.png</xsl:when>
102
                    <xsl:when test="position() 
103
                         mod 2 = 0">/xmltodb/images/bttns-blue.jpg</xsl:when>
104
                  </xsl:choose>
105
                </xsl:attribute>
106
                <xsl:attribute name="name">
107
                  <xsl:value-of select="./docid"/>
108
                </xsl:attribute>
109
              </input>
110
          </td>
111
          <td><xsl:value-of select="./doctitle"/>
112
              <xsl:text>&nbsp;</xsl:text>
113
         </td>
114
          <td>
115
              <xsl:value-of select="./docname"/> 
116
              <xsl:text> </xsl:text>
117
<!--              <xsl:value-of select="./docid"/>
118
              <xsl:text>&nbsp;</xsl:text>
119
-->
120
          </td>
121
<!--          <td><xsl:value-of select="./doctype"/>
122
              <xsl:text>&nbsp;</xsl:text>
123
         </td> 
124
-->
125
          </tr>
126
        </xsl:for-each>
127
        </table>
128
        </form>
129

    
130
      </body>
131
    </html>
132
  </xsl:template>
133

    
134
</xsl:stylesheet>
(3-3/4)