Project

General

Profile

1 51 jones
<?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$'
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
          <h1>Query Results</h1>
28
          <h3>for querystring <xsl:value-of select="resultset/query"/>
29
          </h3>
30
        </center>
31
32
        <table width="100%">
33
        <tr class="rowodd">
34
        <th><xsl:text>Document ID</xsl:text></th>
35
        <th><xsl:text>Title</xsl:text></th>
36
        </tr>
37
38
        <xsl:for-each select="resultset/nodeid">
39
          <tr valign="top">
40
            <xsl:attribute name="class">
41
              <xsl:choose>
42
                <xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>
43
                <xsl:when test="position() mod 2 = 0">rowlight</xsl:when>
44
              </xsl:choose>
45
            </xsl:attribute>
46
47
          <td><a>
48
              <xsl:attribute name="href">
49
              /servlets/MetaCatServlet?action=getdocument&amp;docid=<xsl:value-of select="."/>
50
              </xsl:attribute>
51
              <xsl:text>Document </xsl:text><xsl:value-of select="."/>
52
              </a>
53
          </td>
54
          <td>Fake title</td>
55
          </tr>
56
        </xsl:for-each>
57
        </table>
58
59
      </body>
60
    </html>
61
  </xsl:template>
62
63
</xsl:stylesheet>