You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by as...@apache.org on 2007/09/08 22:17:47 UTC
svn commit: r573901 [38/44] - in /cocoon/site: site/ site/2.0/
site/2.0/developing/ site/2.0/faq/ site/2.0/howto/chaperon/
site/2.0/installing/ site/2.0/plan/ site/2.0/snippet/ site/2.0/tutorial/
site/2.0/userdocs/ site/2.0/userdocs/actions/ site/2.0/u...
Modified: cocoon/site/site/2.0/userdocs/xsp/logicsheet.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/2.0/userdocs/xsp/logicsheet.html?rev=573901&r1=573900&r2=573901&view=diff
==============================================================================
--- cocoon/site/site/2.0/userdocs/xsp/logicsheet.html (original)
+++ cocoon/site/site/2.0/userdocs/xsp/logicsheet.html Sat Sep 8 13:17:41 2007
@@ -1,944 +1,944 @@
-<html>
-<head>
-<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-<title>XSP Logicsheet Guide</title>
-<STYLE type="text/css">
-a.menu {
- color: #FFFFFF;
- text-align:left;
- font-size:12px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight:plain;
- text-decoration:none;
- padding-left: 14px
-}
-
-A.menu:hover {
- color: #FFCC00
-}
-
-
-.menutitle {
- color: #000000;
- text-align:left;
- font-size:10px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight:bold;
- padding-left: 8px
-}
-.menuselected {
- color: #FFCC00;
- text-align:left;
- font-size:12px;
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-weight:bold;
- padding-left: 14px
-}
-</STYLE>
-</head>
-<body bgcolor="#ffffff" marginheight="4" marginwidth="4" leftmargin="4" topmargin="4" alink="#cc0000" vlink="#0086b2" link="#039acc" text="#000000">
-<table border="0" cellpadding="0" cellspacing="0" width="100%">
-<tr>
-<td align="left" valign="top" rowspan="3" height="60" width="135"><img border="0" vspace="0" hspace="0" src="images/logo.gif" height="60" width="135"></td><td background="images/line.gif" rowspan="1" colSpan="2" align="left" valign="top" height="0" width="100%"></td><td align="left" valign="top" rowspan="3" height="60" width="29"><img border="0" vspace="0" hspace="0" src="images/right.gif" height="60" width="29"></td>
-</tr>
-<tr>
-<td bgcolor="#0086b2" colspan="2" align="right" valign="top" height="35" width="100%"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="5">XSP Logicsheet Guide</font></td>
-</tr>
-<tr>
-<td background="images/bottom.gif" colspan="2" width="100%" valign="top" height="20" bgcolor="#0086b2" align="right">
-<table width="288" cellspacing="0" cellpadding="0" border="0">
-<tr>
-<td align="left" valign="top" height="20" width="96"><a target="new" href="http://xml.apache.org/"><img border="0" vspace="0" hspace="0" name="xml" src="images/button-xml-lo.gif" height="20" width="96" alt="http://xml.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.apache.org/"><img border="0" vspace="0" hspace="0" name="asf" src="images/button-asf-lo.gif" height="20" width="96" alt="http://www.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.w3.org/"><img border="0" vspace="0" hspace="0" name="w3c" src="images/button-w3c-lo.gif" height="20" width="96" alt="http://www.w3.org/"></a></td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<table width="100%" cellspacing="0" cellpadding="0" border="0">
-<tr width="100%">
-<td align="left" valign="top" width="120">
-<table width="120" cellspacing="0" cellpadding="0" border="0" bgcolor="#a0a0a0">
-<tr>
-<td valign="top" align="left"><img width="120" vspace="0" src="images/join.gif" hspace="0" height="14" border="0"><br>
-</td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../../index.html">Main</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../index.html">User Documentation</a></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">XSP</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="index.html">Overview</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><span class="menuselected">XSP Guide</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="xsp-internals.html">XSP Internals</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="logicsheet-concepts.html">XSP Logicsheets</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="sessions.html">Sessions</a></td>
-</tr>
-<tr>
-<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
-<span class="menutitle">Logicsheets</span></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="request.html">Request</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="session.html">Session</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="esql.html">ESQL</a></td>
-</tr>
-<tr>
-<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="logicsheet-forms.html">Forms</a></td>
-</tr>
-<tr>
-<td align="left" valign="top"><img width="120" vspace="0" src="images/close.gif" hspace="0" height="14" border="0"><br>
-</td>
-</tr>
-</table>
-</td><td>
-<table cellspacing="15" cellpadding="0" border="0">
-<tr>
-<td>
-
-
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Introduction</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">This document is intended as an introduction and brief tutorial to using and
- creating Apache Cocoon XSP logicsheets. It is assumed that the reader has a working
- knowledge of XML and XSLT, and has worked through at least the basic XSP examples
- supplied with Cocoon. Although this is not intended as a tutorial for XSP
- specifically, much of the material may be helpful in gaining a fuller understanding
- of XSP.</font>
-</p>
-
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Taglibs and logicsheets</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">There is some confusion over the terms "taglib" and "logicsheet". Many people
- will use these terms interchangeably. The term "taglib" comes from JSP, which
- inspired XSP. An XSP logicsheet is a "tag library" in the sense that it defines
- a set of custom XML tags which can be used within an XSP program to insert whole
- blocks of code into the file. Cocoon comes with several pre-defined "taglibs",
- such as the request taglib. Using the request taglib, you can insert the following
- tag into your XSP code to obtain the HTTP request parameter named "fruit" (e.g., if
- your URL looks something like "http://myserver.org/index.xml?fruit=apple", the value
- of "fruit" is "apple"):</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre><request:get-parameter name="fruit"/></pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">We will discuss how to use Cocoon's pre-defined taglibs in a later section. The
- important thing to understand is that all taglibs are defined by a logicsheet. A
- logicsheet, as we will see, is a special kind of XSL stylesheet, whose output is an
- XSP file.</font>
-</p>
-
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Hello World!</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">We'll start with some simple <code><font face="courier, monospaced">Hello, World!</font></code> examples, starting with
- a simple HTML file, and extending it using Cocoon technologies until we have a
- working (if trivial) example of XSP using a custom logicsheet.</font>
-</p>
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Simple HTML Example</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">All of the examples in this section will produce HTML output
- essentially equivalent to this:</font>
-</p>
-
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<html>
- <body>
- <h1>Hello, world!</h1>
- </body>
-</html>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">I did say these would be simple examples, didn't I?</font>
-</p>
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Simple XML/XSL Example</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Here's a simple XML file:</font>
-</p>
-
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-greeting.xml
-
-<?xml version="1.0"?>
-
-<greeting>Hello, world!</greeting>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">...and here's the XSL stylesheet that will transform it into an HTML file
- similar to the one we started this section with:</font>
-</p>
-
-
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-greeting.xsl
-
-<?xml version="1.0"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-
-<xsl:template match="/">
- <html>
- <body>
- <h1>
- <xsl:value-of select="greeting"/>
- </h1>
- </body>
- </html>
-</xsl:template>
-
-</xsl:stylesheet>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">So far, nothing exciting. The input XML has a single element, <greeting>,
- whose text contents gets spit out in HTML. The contents of our particular XML
- file's greeting is, predictably, "Hello, World!" The point of showing you this
- is that, as we elaborate our example by adding Java code through XSP, and later
- with a custom logicsheet, we will continue to use the same stylesheet to format
- our final output. So, the input XML will generally look much like the XML file
- in this most recent trivial example.</font>
-</p>
-
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Simple XSP Example</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Next, we continue in our trivial vein by using trivial Java code to make an
- XSP program, whose output will mimic that of our XML file above. The output
- of this file is transformed to HTML by the same XSL stylesheet as above:</font>
-</p>
-
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-greeting2.xml
-
-<?xml version="1.0"?>
-
-<xsp:page xmlns:xsp="http://apache.org/xsp">
-
- <xsp:logic>
- // this could be arbitrarily complex Java code, JDBC queries, etc.
- String msg = "Hello, world!";
- </xsp:logic>
-
- <greeting>
- <xsp:expr>msg</xsp:expr>
- </greeting>
-
-</xsp:page>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Simple XSP Logicsheet Example</b></font>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Now we are ready to present our final trivial example, using a custom
- logicsheet. There are two files shown below. The first is an XSP file
- that uses a custom logicsheet, logicsheet.greeting.xsl, which is the second
- file shown below.</font>
-</p>
-
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-greeting3.xml
-
-<?xml version="1.0"?>
-
-<xsp:page
- xmlns:xsp="http://apache.org/xsp"
- xmlns:greeting="http://duke.edu/tutorial/greeting">
-
- <greeting>
- <greeting:hello-world/>
- </greeting>
-
-</xsp:page>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-logicsheet.greeting.xsl
-
-<?xml version="1.0"?>
-<xsl:stylesheet
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:xsp="http://apache.org/xsp"
- xmlns:greeting="http://duke.edu/tutorial/greeting"
- version="1.0">
-
-<xsl:template match="xsp:page">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
-</xsl:template>
-
-<xsl:template match="greeting:hello-world">
- <!-- more complex XSLT is possible here as well -->
- <xsp:logic>
- // this could be arbitrarily complex Java code, JDBC queries, etc.
- String msg = "Hello, world!";
- </xsp:logic>
- <xsp:expr>msg</xsp:expr>
-</xsl:template>
-
-<!-- This template simply copies stuff that doesn't match other -->
-<!-- templates and applies templates to any children. -->
-<xsl:template match="@*|node()" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
-</xsl:template>
-
-</xsl:stylesheet>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">There are several things to note about these two files. First, note
- that we inform the XSP processor that it should apply our custom logicsheet
- using the processing instruction</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre><?xml-logicsheet href="logicsheet.greeting.xsl"?></pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">There are other ways to associate a logicsheet with an XSP file, which we'll
- discuss later. Next, note that our logicsheet defines a new namespace,
- <b>greeting:</b>, which must be declared in both files using the same URI:</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>xmlns:greeting="http://duke.edu/tutorial/greeting"</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Note that the URI is completely arbitrary. I've chosen to construct my
- namespace URI's by using my institution's web address (http://duke.edu/)
- followed by the project name (tutorial) and namespace name (greeting).
- You may use any scheme you wish for your namespace URI's; however, the URI
- declared in the logicsheet <b>must</b> match the URI declared in the
- XSP which uses the logicsheet.</font>
-</p>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Finally, note that our logicsheet is merely an XSL stylesheet. It transforms
- one XML file into another. What makes it a logicsheet is that it can be applied
- not just to any XML file, but specifically to an XSP file, and the end result of
- its transformation is another XSP file. If you were to apply the logicsheet in
- this example to the XML file in this example as just a stylesheet (with no XSP
- processing), you would end up with something like the following (compare to our
- earlier XSP example):</font>
-</p>
-
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<?xml version="1.0"?>
-
-<xsp:page
- xmlns:greeting="http://duke.edu/tutorial/greeting"
- xmlns:xsp="http://apache.org/xsp">
-
- <greeting>
- <xsp:logic>
- // this could be arbitrarily complex Java code, JDBC queries, etc.
- String msg = &quot;Hello, world!&quot;;
- </xsp:logic>
- <xsp:expr>msg</xsp:expr>
- </greeting>
-</xsp:page>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Using Logicsheets (Taglibs)</font>
-<hr style="color: #0086b2" size="1">
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">There are two ways to apply a logicsheet, once you have written it.
- First, as in the previous examples, you can tell XSP explicitly what
- logicsheets to apply, using the <?xml-logicsheet?> processing instruction
- right after xml header and before <xsp:page> tag:</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<?xml version="1.0"?>
-
-<?xml-logicsheet href="logicsheet.greeting.xsl"?>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">There is another way to apply a logicsheet, which doesn't require a
- processing instruction for each file that uses the logicsheet. The
- second way is to declare logicsheet in the cocoon.xconf file.
- These declarations take the form</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<builtin-logicsheet>
- <parameter name="prefix" value="&lt;logicsheet's prefix&gt;"/>
- <parameter name="uri" value="&lt;logicsheet's namespace URI&gt;"/>
- <parameter name="href" value="&lt;URL to file&gt;"/>
-</builtin-logicsheet>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Cocoon's pre-defined logicsheets are already declared in this file. For
- instance, the declaration of the XSP request taglib is the following:</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<builtin-logicsheet>
- <parameter name="prefix" value="xsp-request"/>
- <parameter name="uri" value="http://apache.org/xsp/request/2.0"/>
- <parameter name="href"
- value="resource://.../markup/xsp/java/request.xsl"/>
-</builtin-logicsheet>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">This line associates the <b>http://apache.org/xsp/request/2.0</b>
- namespace with the logicsheet named in the URL. This URL points to a file
- that is stored in the cocoon.jar. To use the request taglib, you must
- declare the request namespace in your XSP file:</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-...
-<xsp:page
- xmlns:xsp="http://apache.org/xsp"
- xmlns:xsp-request="http://apache.org/xsp/request/2.0"
->
-...
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<table border="0" cellpadding="0" cellspacing="3" width="100%">
-<tr>
-<td valign="top" width="28"><img alt="Note" border="0" hspace="0" vspace="0" height="29" width="28" src="images/note.gif"></td><td valign="top"><font color="black" face="verdana,helvetica,sanserif" size="-1"><i>You should <b>not</b> try to apply the xsp-request
- taglib using the <?xml-logicsheet?> processing instruction,
- as this will result in the logicsheet being applied twice.</i></font></td>
-</tr>
-</table>
-</p>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">You can add your own logicsheets to the cocoon.xconf file using the same
- syntax. The only trick is constructing an appropriate URL. If we wanted to
- declare our <b>greeting:</b> namespace and logicsheet from the
- Hello, World! example above, and if the logicsheet were stored (on a UNIX
- filesystem) in the location /cocoon/logicsheets/logicsheet.greeting.xsl,
- we'd add this line to cocoon.xconf:</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<builtin-logicsheet>
- <parameter name="prefix" value="greeting"/>
- <parameter name="uri" value="http://duke.edu/tutorial/greeting"/>
- <parameter name="href"
- value="file:///cocoon/logicsheets/logicsheet.greeting.xsl"/>
-</builtin-logicsheet>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">There are some very important differences between using the <?xml-logicsheet?>
- processing instruction vs. the cocoon.properties entry to apply a logicsheet.
- Using cocoon.properties, any time the logicsheet changes, it is necessary to
- restart Cocoon. If you instead use the processing instruction, Cocoon will detect
- modifications to your logicsheet, and recompile your XSP programs accordingly.
- Also, if you need to explicitly control the order in which your logicsheets are
- applied, you need to use the processing instruction. Logicsheets will be applied
- in the order in which they appear in processing instructions in your source file.</font>
-</p>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Whichever method you use, the most important thing to remember is that you must
- declare, in your XSP program, the namespace for a logicsheet using the same URI as
- in the logicsheet itself.</font>
-</p>
-
-
-
-<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Logicsheet Development Tips</font>
-<hr style="color: #0086b2" size="1">
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Development Practices</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Developing Logicsheets can be a frustrating mental exercise, as it requires you
- to understand and keep in mind the complex coordination of several different
- technologies: XML, XSLT, XSP, and Java. A bad assumption in any of these areas
- can lead to an hour of debugging. Following a few simple practices can reduce the
- frustration and make logicsheet programming less difficult:</font>
-</p>
-
-<blockquote>
-<font face="verdana, helvetica, sans serif">
-<dl>
-
-<dt>
-<strong>Small Increments</strong> - </dt>
-
-<dd>As with any software development, it is much easier to debug a small amount
- of code than a large amount of code. XSP is no different, except that the
- complexity of a large amount of code is multiplied by the number of different
- technologies. So, write a tiny bit of code and get it working, or start with a
- simple piece of code that is already working. Make small changes, and get each
- change working before making the next.</dd>
-
-<dt>
-<strong>Prototype New Ideas</strong> - </dt>
-
-<dd>Before trying something you haven't done before (e.g., a new XPath expression,
- a new Java syntax), prototype it in a simple environment where you can easily see
- the results of your code. It is more difficult to debug your changes if the output
- is filtered through multiple stylesheets and rendered into HTML. So instead, write
- a small XSP that you can use to test your code fragment and see the resulting XML.</dd>
-
-<dt>
-<strong>Use the Source</strong> - </dt>
-
-<dd>After transforming your XSP code with your logicsheet, the XSP processor writes
- the resulting Java code to a file in your repository. The repository is in a
- directory specified in cocoon.properties. Make a shortcut to your repository
- directory and go there often. Read the code that resulted from application of your
- stylesheet. This lets you debug the Java code as Java code, absent from all of the
- XML/XSL complications. It also lets you see exactly the results of XSLT transformation
- using your logicsheet.</dd>
-
-<dt>
-<strong>Steal Code</strong> - </dt>
-
-<dd>The authors of the logicsheets distributed with Cocoon have already solved
- numerous problems that you may encounter. Read their code (it is in the source
- tree) and borrow from it liberally. Reading this code is also a good way to
- gain insight into logicsheet design.</dd>
-
-</dl>
-</font>
-</blockquote>
-
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Standard Templates</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">As we discussed earlier, a logicsheet is just an XSLT stylesheet which transforms
- one XSP source file into another. Since we are always expecting to act on an XSP
- source file, and there is the possibility that other logicsheets may also be acting
- on the same file (either before or after our logicsheet), there are a few templates
- which are more or less required in any logicsheet. The templates below were all
- pulled from the taglib logicsheets distributed with Cocoon.</font>
-</p>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">The first of these is simply a template to copy anything you don't directly act
- upon yourself. You probably have a template similar to this in most of your
- stylesheets already.</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<xsl:template match="@*|node()" priority="-1">
- <xsl:copy>
- <xsl:apply-templates select="@*|node()"/>
- </xsl:copy>
-</xsl:template>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">If your code requires any Java imports, or if you want to declare methods or
- variables at the class level, you will need to have a way to add elements to the
- <xsp:page> element that is at the root of the source file. Here is a template
- to let you do that (from esql.xsl):</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<xsl:template match="xsp:page">
- <xsp:page>
- <xsl:apply-templates select="@*"/>
- <xsp:structure>
- // you can put &lt;xsp:include> statements in here to import Java classes
- </xsp:structure>
- <xsp:logic>
- // put class-level variable declarations and methods here
- </xsp:logic>
- </xsp:page>
-</xsl:template>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Frequently, you may also need to declare variables or perform initialization
- that needs to occur before any of the code in your custom tags. You could, of
- course, require that the users of your logicsheet use one particular tag before
- using any other, and then put your declarations and initializations in the template
- matching that one tag. This may not be the best solution, however, and may be
- a source of confusion. Instead, the following template can be used to insert
- code inside the populateDocument() method, after the standard XSP code (such as
- declaration of the request and response variables), but before any user code
- from the source XSP file (including code inserted by your custom tags). The
- complex XPath expression here just says "match on any child elements of <xsp:page
- which don't themselves begin with 'xsp:'". Since the <xsp:page> element always
- has a single element which isn't in the xsp: namespace, this will be matched once
- and only once.</font>
-</p>
-
-<div align="center">
-<table border="0" cellpadding="0" cellspacing="4">
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
-<pre>
-<xsl:template match="xsp:page/*[not(starts-with(name(.), 'xsp:'))]">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsp:logic>
- // This code ends up inside populateDocument() before any user code
- </xsp:logic>
- <xsl:apply-templates/>
- </xsl:copy>
-</xsl:template>
-</pre>
-</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-<tr>
-<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
-</tr>
-</table>
-</div>
-
-
-
-
-<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Logicsheets Using Logicsheets</b></font>
-
-<p>
-<font color="black" face="verdana,helvetica,sanserif">Since software tends to build on other software, you will probably find
- yourself wanting to write logicsheets which make use of other logicsheets,
- particularly the logicsheets provided with Cocoon. This is very possible.
- When using one logicsheet inside another, the most important thing to remember
- is that you must declare the namespace for the second logicsheet not only in
- the first logicsheet, but also in any XSP program that uses the first logicsheet,
- even if it doesn't directly reference any of the tags in the second logicsheet.</font>
-</p>
-
-
-
-
-
-
-
-</td>
-</tr>
-</table>
-</td>
-</tr>
-</table>
-<table width="100%" cellspacing="0" cellpadding="0" border="0">
-<tr>
-<td bgcolor="#0086b2"><img width="1" src="images/dot.gif" height="1"></td>
-</tr>
-<tr>
-<td align="center"><font size="-1" face="arial,helvetica,sanserif" color="#0086b2"><i>Copyright © 1999-2002 The Apache Software Foundation. All Rights Reserved.</i></font></td>
-</tr>
-</table>
-</body>
-</html>
+<html>
+<head>
+<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+<title>XSP Logicsheet Guide</title>
+<STYLE type="text/css">
+a.menu {
+ color: #FFFFFF;
+ text-align:left;
+ font-size:12px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight:plain;
+ text-decoration:none;
+ padding-left: 14px
+}
+
+A.menu:hover {
+ color: #FFCC00
+}
+
+
+.menutitle {
+ color: #000000;
+ text-align:left;
+ font-size:10px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ padding-left: 8px
+}
+.menuselected {
+ color: #FFCC00;
+ text-align:left;
+ font-size:12px;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-weight:bold;
+ padding-left: 14px
+}
+</STYLE>
+</head>
+<body bgcolor="#ffffff" marginheight="4" marginwidth="4" leftmargin="4" topmargin="4" alink="#cc0000" vlink="#0086b2" link="#039acc" text="#000000">
+<table border="0" cellpadding="0" cellspacing="0" width="100%">
+<tr>
+<td align="left" valign="top" rowspan="3" height="60" width="135"><img border="0" vspace="0" hspace="0" src="images/logo.gif" height="60" width="135"></td><td background="images/line.gif" rowspan="1" colSpan="2" align="left" valign="top" height="0" width="100%"></td><td align="left" valign="top" rowspan="3" height="60" width="29"><img border="0" vspace="0" hspace="0" src="images/right.gif" height="60" width="29"></td>
+</tr>
+<tr>
+<td bgcolor="#0086b2" colspan="2" align="right" valign="top" height="35" width="100%"><font color="#ffffff" face="Verdana, Arial, Helvetica, sans-serif" size="5">XSP Logicsheet Guide</font></td>
+</tr>
+<tr>
+<td background="images/bottom.gif" colspan="2" width="100%" valign="top" height="20" bgcolor="#0086b2" align="right">
+<table width="288" cellspacing="0" cellpadding="0" border="0">
+<tr>
+<td align="left" valign="top" height="20" width="96"><a target="new" href="http://xml.apache.org/"><img border="0" vspace="0" hspace="0" name="xml" src="images/button-xml-lo.gif" height="20" width="96" alt="http://xml.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.apache.org/"><img border="0" vspace="0" hspace="0" name="asf" src="images/button-asf-lo.gif" height="20" width="96" alt="http://www.apache.org/"></a></td><td align="left" valign="top" height="20" width="96"><a target="new" href="http://www.w3.org/"><img border="0" vspace="0" hspace="0" name="w3c" src="images/button-w3c-lo.gif" height="20" width="96" alt="http://www.w3.org/"></a></td>
+</tr>
+</table>
+</td>
+</tr>
+</table>
+<table width="100%" cellspacing="0" cellpadding="0" border="0">
+<tr width="100%">
+<td align="left" valign="top" width="120">
+<table width="120" cellspacing="0" cellpadding="0" border="0" bgcolor="#a0a0a0">
+<tr>
+<td valign="top" align="left"><img width="120" vspace="0" src="images/join.gif" hspace="0" height="14" border="0"><br>
+</td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../../index.html">Main</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="../index.html">User Documentation</a></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">XSP</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="index.html">Overview</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><span class="menuselected">XSP Guide</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="xsp-internals.html">XSP Internals</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="logicsheet-concepts.html">XSP Logicsheets</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="sessions.html">Sessions</a></td>
+</tr>
+<tr>
+<td background="images/label-background_b.gif" bgcolor="#959595" valign="top"><img width="120" height="6" src="images/separator.gif"><br>
+<span class="menutitle">Logicsheets</span></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="request.html">Request</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="session.html">Session</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="esql.html">ESQL</a></td>
+</tr>
+<tr>
+<td valign="top" bgcolor="#959595" background="images/label-background_a.gif"><a class="menu" href="logicsheet-forms.html">Forms</a></td>
+</tr>
+<tr>
+<td align="left" valign="top"><img width="120" vspace="0" src="images/close.gif" hspace="0" height="14" border="0"><br>
+</td>
+</tr>
+</table>
+</td><td>
+<table cellspacing="15" cellpadding="0" border="0">
+<tr>
+<td>
+
+
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Introduction</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">This document is intended as an introduction and brief tutorial to using and
+ creating Apache Cocoon XSP logicsheets. It is assumed that the reader has a working
+ knowledge of XML and XSLT, and has worked through at least the basic XSP examples
+ supplied with Cocoon. Although this is not intended as a tutorial for XSP
+ specifically, much of the material may be helpful in gaining a fuller understanding
+ of XSP.</font>
+</p>
+
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Taglibs and logicsheets</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">There is some confusion over the terms "taglib" and "logicsheet". Many people
+ will use these terms interchangeably. The term "taglib" comes from JSP, which
+ inspired XSP. An XSP logicsheet is a "tag library" in the sense that it defines
+ a set of custom XML tags which can be used within an XSP program to insert whole
+ blocks of code into the file. Cocoon comes with several pre-defined "taglibs",
+ such as the request taglib. Using the request taglib, you can insert the following
+ tag into your XSP code to obtain the HTTP request parameter named "fruit" (e.g., if
+ your URL looks something like "http://myserver.org/index.xml?fruit=apple", the value
+ of "fruit" is "apple"):</font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre><request:get-parameter name="fruit"/></pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">We will discuss how to use Cocoon's pre-defined taglibs in a later section. The
+ important thing to understand is that all taglibs are defined by a logicsheet. A
+ logicsheet, as we will see, is a special kind of XSL stylesheet, whose output is an
+ XSP file.</font>
+</p>
+
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Hello World!</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">We'll start with some simple <code><font face="courier, monospaced">Hello, World!</font></code> examples, starting with
+ a simple HTML file, and extending it using Cocoon technologies until we have a
+ working (if trivial) example of XSP using a custom logicsheet.</font>
+</p>
+
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Simple HTML Example</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">All of the examples in this section will produce HTML output
+ essentially equivalent to this:</font>
+</p>
+
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+<html>
+ <body>
+ <h1>Hello, world!</h1>
+ </body>
+</html>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">I did say these would be simple examples, didn't I?</font>
+</p>
+
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Simple XML/XSL Example</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">Here's a simple XML file:</font>
+</p>
+
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+greeting.xml
+
+<?xml version="1.0"?>
+
+<greeting>Hello, world!</greeting>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">...and here's the XSL stylesheet that will transform it into an HTML file
+ similar to the one we started this section with:</font>
+</p>
+
+
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+greeting.xsl
+
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<xsl:template match="/">
+ <html>
+ <body>
+ <h1>
+ <xsl:value-of select="greeting"/>
+ </h1>
+ </body>
+ </html>
+</xsl:template>
+
+</xsl:stylesheet>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">So far, nothing exciting. The input XML has a single element, <greeting>,
+ whose text contents gets spit out in HTML. The contents of our particular XML
+ file's greeting is, predictably, "Hello, World!" The point of showing you this
+ is that, as we elaborate our example by adding Java code through XSP, and later
+ with a custom logicsheet, we will continue to use the same stylesheet to format
+ our final output. So, the input XML will generally look much like the XML file
+ in this most recent trivial example.</font>
+</p>
+
+
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Simple XSP Example</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">Next, we continue in our trivial vein by using trivial Java code to make an
+ XSP program, whose output will mimic that of our XML file above. The output
+ of this file is transformed to HTML by the same XSL stylesheet as above:</font>
+</p>
+
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+greeting2.xml
+
+<?xml version="1.0"?>
+
+<xsp:page xmlns:xsp="http://apache.org/xsp">
+
+ <xsp:logic>
+ // this could be arbitrarily complex Java code, JDBC queries, etc.
+ String msg = "Hello, world!";
+ </xsp:logic>
+
+ <greeting>
+ <xsp:expr>msg</xsp:expr>
+ </greeting>
+
+</xsp:page>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Simple XSP Logicsheet Example</b></font>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">Now we are ready to present our final trivial example, using a custom
+ logicsheet. There are two files shown below. The first is an XSP file
+ that uses a custom logicsheet, logicsheet.greeting.xsl, which is the second
+ file shown below.</font>
+</p>
+
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+greeting3.xml
+
+<?xml version="1.0"?>
+
+<xsp:page
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:greeting="http://duke.edu/tutorial/greeting">
+
+ <greeting>
+ <greeting:hello-world/>
+ </greeting>
+
+</xsp:page>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+logicsheet.greeting.xsl
+
+<?xml version="1.0"?>
+<xsl:stylesheet
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:greeting="http://duke.edu/tutorial/greeting"
+ version="1.0">
+
+<xsl:template match="xsp:page">
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:apply-templates/>
+ </xsl:copy>
+</xsl:template>
+
+<xsl:template match="greeting:hello-world">
+ <!-- more complex XSLT is possible here as well -->
+ <xsp:logic>
+ // this could be arbitrarily complex Java code, JDBC queries, etc.
+ String msg = "Hello, world!";
+ </xsp:logic>
+ <xsp:expr>msg</xsp:expr>
+</xsl:template>
+
+<!-- This template simply copies stuff that doesn't match other -->
+<!-- templates and applies templates to any children. -->
+<xsl:template match="@*|node()" priority="-1">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">There are several things to note about these two files. First, note
+ that we inform the XSP processor that it should apply our custom logicsheet
+ using the processing instruction</font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre><?xml-logicsheet href="logicsheet.greeting.xsl"?></pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">There are other ways to associate a logicsheet with an XSP file, which we'll
+ discuss later. Next, note that our logicsheet defines a new namespace,
+ <b>greeting:</b>, which must be declared in both files using the same URI:</font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>xmlns:greeting="http://duke.edu/tutorial/greeting"</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">Note that the URI is completely arbitrary. I've chosen to construct my
+ namespace URI's by using my institution's web address (http://duke.edu/)
+ followed by the project name (tutorial) and namespace name (greeting).
+ You may use any scheme you wish for your namespace URI's; however, the URI
+ declared in the logicsheet <b>must</b> match the URI declared in the
+ XSP which uses the logicsheet.</font>
+</p>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">Finally, note that our logicsheet is merely an XSL stylesheet. It transforms
+ one XML file into another. What makes it a logicsheet is that it can be applied
+ not just to any XML file, but specifically to an XSP file, and the end result of
+ its transformation is another XSP file. If you were to apply the logicsheet in
+ this example to the XML file in this example as just a stylesheet (with no XSP
+ processing), you would end up with something like the following (compare to our
+ earlier XSP example):</font>
+</p>
+
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+<?xml version="1.0"?>
+
+<xsp:page
+ xmlns:greeting="http://duke.edu/tutorial/greeting"
+ xmlns:xsp="http://apache.org/xsp">
+
+ <greeting>
+ <xsp:logic>
+ // this could be arbitrarily complex Java code, JDBC queries, etc.
+ String msg = &quot;Hello, world!&quot;;
+ </xsp:logic>
+ <xsp:expr>msg</xsp:expr>
+ </greeting>
+</xsp:page>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Using Logicsheets (Taglibs)</font>
+<hr style="color: #0086b2" size="1">
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">There are two ways to apply a logicsheet, once you have written it.
+ First, as in the previous examples, you can tell XSP explicitly what
+ logicsheets to apply, using the <?xml-logicsheet?> processing instruction
+ right after xml header and before <xsp:page> tag:</font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+<?xml version="1.0"?>
+
+<?xml-logicsheet href="logicsheet.greeting.xsl"?>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">There is another way to apply a logicsheet, which doesn't require a
+ processing instruction for each file that uses the logicsheet. The
+ second way is to declare logicsheet in the cocoon.xconf file.
+ These declarations take the form</font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+<builtin-logicsheet>
+ <parameter name="prefix" value="&lt;logicsheet's prefix&gt;"/>
+ <parameter name="uri" value="&lt;logicsheet's namespace URI&gt;"/>
+ <parameter name="href" value="&lt;URL to file&gt;"/>
+</builtin-logicsheet>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">Cocoon's pre-defined logicsheets are already declared in this file. For
+ instance, the declaration of the XSP request taglib is the following:</font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+<builtin-logicsheet>
+ <parameter name="prefix" value="xsp-request"/>
+ <parameter name="uri" value="http://apache.org/xsp/request/2.0"/>
+ <parameter name="href"
+ value="resource://.../markup/xsp/java/request.xsl"/>
+</builtin-logicsheet>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">This line associates the <b>http://apache.org/xsp/request/2.0</b>
+ namespace with the logicsheet named in the URL. This URL points to a file
+ that is stored in the cocoon.jar. To use the request taglib, you must
+ declare the request namespace in your XSP file:</font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+...
+<xsp:page
+ xmlns:xsp="http://apache.org/xsp"
+ xmlns:xsp-request="http://apache.org/xsp/request/2.0"
+>
+...
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<table border="0" cellpadding="0" cellspacing="3" width="100%">
+<tr>
+<td valign="top" width="28"><img alt="Note" border="0" hspace="0" vspace="0" height="29" width="28" src="images/note.gif"></td><td valign="top"><font color="black" face="verdana,helvetica,sanserif" size="-1"><i>You should <b>not</b> try to apply the xsp-request
+ taglib using the <?xml-logicsheet?> processing instruction,
+ as this will result in the logicsheet being applied twice.</i></font></td>
+</tr>
+</table>
+</p>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">You can add your own logicsheets to the cocoon.xconf file using the same
+ syntax. The only trick is constructing an appropriate URL. If we wanted to
+ declare our <b>greeting:</b> namespace and logicsheet from the
+ Hello, World! example above, and if the logicsheet were stored (on a UNIX
+ filesystem) in the location /cocoon/logicsheets/logicsheet.greeting.xsl,
+ we'd add this line to cocoon.xconf:</font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+<builtin-logicsheet>
+ <parameter name="prefix" value="greeting"/>
+ <parameter name="uri" value="http://duke.edu/tutorial/greeting"/>
+ <parameter name="href"
+ value="file:///cocoon/logicsheets/logicsheet.greeting.xsl"/>
+</builtin-logicsheet>
+</pre>
+</td><td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+</table>
+</div>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">There are some very important differences between using the <?xml-logicsheet?>
+ processing instruction vs. the cocoon.properties entry to apply a logicsheet.
+ Using cocoon.properties, any time the logicsheet changes, it is necessary to
+ restart Cocoon. If you instead use the processing instruction, Cocoon will detect
+ modifications to your logicsheet, and recompile your XSP programs accordingly.
+ Also, if you need to explicitly control the order in which your logicsheets are
+ applied, you need to use the processing instruction. Logicsheets will be applied
+ in the order in which they appear in processing instructions in your source file.</font>
+</p>
+
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">Whichever method you use, the most important thing to remember is that you must
+ declare, in your XSP program, the namespace for a logicsheet using the same URI as
+ in the logicsheet itself.</font>
+</p>
+
+
+
+<font face="verdana, helvetica, sans serif" size="+2" color="#0086b2">Logicsheet Development Tips</font>
+<hr style="color: #0086b2" size="1">
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Development Practices</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">Developing Logicsheets can be a frustrating mental exercise, as it requires you
+ to understand and keep in mind the complex coordination of several different
+ technologies: XML, XSLT, XSP, and Java. A bad assumption in any of these areas
+ can lead to an hour of debugging. Following a few simple practices can reduce the
+ frustration and make logicsheet programming less difficult:</font>
+</p>
+
+<blockquote>
+<font face="verdana, helvetica, sans serif">
+<dl>
+
+<dt>
+<strong>Small Increments</strong> - </dt>
+
+<dd>As with any software development, it is much easier to debug a small amount
+ of code than a large amount of code. XSP is no different, except that the
+ complexity of a large amount of code is multiplied by the number of different
+ technologies. So, write a tiny bit of code and get it working, or start with a
+ simple piece of code that is already working. Make small changes, and get each
+ change working before making the next.</dd>
+
+<dt>
+<strong>Prototype New Ideas</strong> - </dt>
+
+<dd>Before trying something you haven't done before (e.g., a new XPath expression,
+ a new Java syntax), prototype it in a simple environment where you can easily see
+ the results of your code. It is more difficult to debug your changes if the output
+ is filtered through multiple stylesheets and rendered into HTML. So instead, write
+ a small XSP that you can use to test your code fragment and see the resulting XML.</dd>
+
+<dt>
+<strong>Use the Source</strong> - </dt>
+
+<dd>After transforming your XSP code with your logicsheet, the XSP processor writes
+ the resulting Java code to a file in your repository. The repository is in a
+ directory specified in cocoon.properties. Make a shortcut to your repository
+ directory and go there often. Read the code that resulted from application of your
+ stylesheet. This lets you debug the Java code as Java code, absent from all of the
+ XML/XSL complications. It also lets you see exactly the results of XSLT transformation
+ using your logicsheet.</dd>
+
+<dt>
+<strong>Steal Code</strong> - </dt>
+
+<dd>The authors of the logicsheets distributed with Cocoon have already solved
+ numerous problems that you may encounter. Read their code (it is in the source
+ tree) and borrow from it liberally. Reading this code is also a good way to
+ gain insight into logicsheet design.</dd>
+
+</dl>
+</font>
+</blockquote>
+
+
+
+<font face="verdana, helvetica, sans serif" size="+1" color="#0086b2"><b>Standard Templates</b></font>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">As we discussed earlier, a logicsheet is just an XSLT stylesheet which transforms
+ one XSP source file into another. Since we are always expecting to act on an XSP
+ source file, and there is the possibility that other logicsheets may also be acting
+ on the same file (either before or after our logicsheet), there are a few templates
+ which are more or less required in any logicsheet. The templates below were all
+ pulled from the taglib logicsheets distributed with Cocoon.</font>
+</p>
+
+<p>
+<font color="black" face="verdana,helvetica,sanserif">The first of these is simply a template to copy anything you don't directly act
+ upon yourself. You probably have a template similar to this in most of your
+ stylesheets already.</font>
+</p>
+
+<div align="center">
+<table border="0" cellpadding="0" cellspacing="4">
+<tr>
+<td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td height="1" width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td>
+</tr>
+<tr>
+<td width="1" bgcolor="#0086b2"><img border="0" hspace="0" vspace="0" height="1" width="1" src="images/void.gif"></td><td bgcolor="#ffffff">
+<pre>
+<xsl:template match="@*|node()" priority="-1">
+ <xsl:copy>
[... 129 lines stripped ...]