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 |
85
|
jones
|
<form action="/servlets/MetaCatServlet" method="POST">
|
33 |
|
|
<input type="hidden" name="action" value="getdocument"/>
|
34 |
|
|
|
35 |
|
|
<xsl:text>Output Format: </xsl:text>
|
36 |
|
|
<select name="qformat">
|
37 |
|
|
<option value="html">HTML</option>
|
38 |
|
|
<option value="xml">XML</option>
|
39 |
|
|
</select>
|
40 |
|
|
|
41 |
51
|
jones
|
<table width="100%">
|
42 |
|
|
<tr class="rowodd">
|
43 |
85
|
jones
|
<th> </th>
|
44 |
101
|
jones
|
<th><xsl:text>Title</xsl:text></th>
|
45 |
98
|
jones
|
<th><xsl:text>Document</xsl:text></th>
|
46 |
|
|
<th><xsl:text>Document Type</xsl:text></th>
|
47 |
51
|
jones
|
</tr>
|
48 |
|
|
|
49 |
98
|
jones
|
<xsl:for-each select="resultset/document">
|
50 |
51
|
jones
|
<tr valign="top">
|
51 |
|
|
<xsl:attribute name="class">
|
52 |
|
|
<xsl:choose>
|
53 |
|
|
<xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>
|
54 |
|
|
<xsl:when test="position() mod 2 = 0">rowlight</xsl:when>
|
55 |
|
|
</xsl:choose>
|
56 |
|
|
</xsl:attribute>
|
57 |
|
|
|
58 |
85
|
jones
|
<td>
|
59 |
103
|
jones
|
<!--
|
60 |
85
|
jones
|
<input type="radio" name="docid">
|
61 |
|
|
<xsl:attribute name="value">
|
62 |
98
|
jones
|
<xsl:value-of select="./docid"/>
|
63 |
85
|
jones
|
</xsl:attribute>
|
64 |
|
|
</input>
|
65 |
|
|
<input type="submit" value="Display"/>
|
66 |
103
|
jones
|
-->
|
67 |
|
|
<input border="0" type="image">
|
68 |
|
|
<xsl:attribute name="src">
|
69 |
|
|
<xsl:choose>
|
70 |
|
|
<xsl:when test="position()
|
71 |
|
|
mod 2 = 1">/xmltodb/images/bttns-white.png</xsl:when>
|
72 |
|
|
<xsl:when test="position()
|
73 |
|
|
mod 2 = 0">/xmltodb/images/bttns-blue.jpg</xsl:when>
|
74 |
|
|
</xsl:choose>
|
75 |
|
|
</xsl:attribute>
|
76 |
|
|
<xsl:attribute name="name">
|
77 |
102
|
jones
|
<xsl:value-of select="./docid"/>
|
78 |
|
|
</xsl:attribute>
|
79 |
|
|
</input>
|
80 |
51
|
jones
|
</td>
|
81 |
101
|
jones
|
<td><xsl:value-of select="./doctitle"/>
|
82 |
|
|
<xsl:text> </xsl:text>
|
83 |
|
|
</td>
|
84 |
85
|
jones
|
<td>
|
85 |
98
|
jones
|
<xsl:value-of select="./docname"/>
|
86 |
|
|
<xsl:text> </xsl:text>
|
87 |
|
|
<xsl:value-of select="./docid"/>
|
88 |
101
|
jones
|
<xsl:text> </xsl:text>
|
89 |
85
|
jones
|
</td>
|
90 |
101
|
jones
|
<td><xsl:value-of select="./doctype"/>
|
91 |
|
|
<xsl:text> </xsl:text>
|
92 |
|
|
</td>
|
93 |
51
|
jones
|
</tr>
|
94 |
|
|
</xsl:for-each>
|
95 |
|
|
</table>
|
96 |
85
|
jones
|
</form>
|
97 |
51
|
jones
|
|
98 |
|
|
</body>
|
99 |
|
|
</html>
|
100 |
|
|
</xsl:template>
|
101 |
|
|
|
102 |
|
|
</xsl:stylesheet>
|