You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Ricardo Rocha <ri...@apache.org> on 2000/03/28 00:48:41 UTC
Re: Problem with XSP
Hi Herv�,
On Mon, 27 Mar 2000, Herv� Guidetti wrote:
> I've read your XSP Processor - A Primer Web site. Very well done. Thanks a
> lot for your work.
Thanks! More docs are coming: a mini-tutorial on logicsheet authoring and
a description of the core logicsheets and their associated utility classes.
> I've tried the two first example (the Date). The first one works. The second
> one (with the tag lib) doen't.
> <xsp:page
> language="java"
> xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> xmlns:example="http://www.plenix.com/DTD/XSP/Example"
> <page title="Time of Day">
> <p>
> To the best of my knowledge, it's now
> <!-- Substitute time of day here -->
> <example:time-of-day format="yy/MM/dd hh:mm:ss aa"/>
> </p>
> </page>
> </xsp:page>
> Why Cocoon doesn't transform the <example:time-of-day> tag ?
> Where do I "said" to Cocoon the existence of the mylib file ? And how ?
For this xsp page to work, it's necessary that you either:
1) implicitly associate a logicsheet with the "example"
namespace, or
2) explicitly associate your logicsheet with your particular
xsp page (the preferred method for non-core taglibs)
Logicsheets are implicitly associated with namespaces
in the xsp section of the "cocoon.properties" conf file.
For the above namespace/logicsheet pair, for instance,
your cocoon.properties entry might look like:
processor.type.xsp = org.apache.cocoon.processor.xsp.XSPProcessor
. . .
processor.xsp.logicsheet.example.java = file:///www/logicsheets/example.xsl
. . .
Here, you're indicating you have an xsp logicsheet ("example.xsl")
which is associated with the "example" namespace and uses Java
as the scripting language.
This is the way xsp works in Cocoon 1.6
If you've downloaded the latest Cocoon 1.7 you may prefer to
use the simpler approach of explicitly associating your logicsheet
with your xsp page without a namespace association.
This is achieved by means of the <?xml-logicsheet?> processing
instruction, like in:
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?xml-logicsheet href="file:///www/logicsheets/example.xsl"?>
. . .
<xsp:page
language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:example="http://www.plenix.com/DTD/XSP/Example"
>
. . .
</xsp:page>
Note that you still must declare the "example" namespace in your
<xsp:page> root element. This is necessary for regular namespace
processing (you're using <example:time-of-day>) but is _not_
[any longer] related to logicsheet processing.
Regards,
Ricardo