Logicsheets
Logicsheets are XSL files with an associated namespace.
Primary mechanism to add program logic ( code ) to XSPs.
These need to be registered in configuration file cocoon.xconf.
Logicsheets are used by the generator to transform XML structure before generating program.
Cocoon comes with a no. of built-in logic sheets:
- request.xsl
- response.xsl
- session.xsl
- cookie.xsl
- esql.xsl
- log.xsl
- ….
<xsl:stylesheet version="1.0" xmlns:xsp="http://apache.org/xsp" xmlns:log="http://apache.org/xsp/log" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="log:logger">
… variable and xsp:logic statements ...
<xsl:template match="log:debug">
getLogger().debug("<xsl:value-of select="."/>");
<xsl:template match="log:error">
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:log="http://apache.org/xsp/log">
<log:logger name=”test" filename=”test.log"/>
<log:debug>Test Message</log:debug>