cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Cocoon2 Logicsheet example with static functions (fwd)
Date Tue, 09 Jan 2001 15:44:54 GMT

Hello fellow cocoon-users,

I see a lot of replies to other questions, but not to mine.

I dare you to make an XSP taglib in Cocoon2 which implements
the static count() function..

The util.xsp file in the Cocoon2 repository does not work. All the
tags are ignored, somehow. The log and request taglib work fine.
(I haven't tested the rest). The docs/samples/slides/lib-page.xml
does not work (it shows the util taglib)..

Has anybody gottem them to work? 

One more 'lame' question: it seems that Cocoon 2 does not support the
<?cocoon-process ...?> and <?xml-stylesheet ?> tags anymore.
Do you really have to put everything in the sitemap? That means
restarting Tomcat every time you add a page needing special treatment,
like a different stylesheet... this works kinda slow.


---------- Forwarded message ----------
Date: Tue, 9 Jan 2001 03:28:41 +0000 (UTC)
From: Forge <>
Subject: [C2] Logicsheet example with static functions

Hello there,

Does anyone have a logicsheet example with static functions in it?
At the end i've included my logicsheet. It does not seem to work..
What does work is the generation of the 'count();' template.
This all worked fine in Cocoon 1. Maybe I'm missing something here;
the logicsheet-concepts document tells me that you should make
a helper class, preferably, but it also speaks about the
<xsp:logic> tag right below the <xsp:page> tag, which is used
to generate class-level static functions. Maybe this does not go
for tag-libs, but just for generator-level xsp pages (I mean that
the xsp page must be the first in the pipeline..).

Also I've noticed that the xsp:expr tag does not work the same:
<xsp:expr>count()</xsp:expr> worked fine in cocoon 1, but in Cocoon2
it seems to literally copy it in the java-source for the generator,
which gives a compilation error because it misses the ';'.

Anyway, when I run a simple xml page through cocoon it gives me the
compiler error:

Error compiling _index_xml: Line 188, column 9: Method count() not found
in class _home._forge._work._neostream._pages._index_xml.

which is because it ignores the <xsl:logic/> tag's content..

Can anybody please help?



<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
  <xsl:template match="xsp:page">
      <xsl:apply-templates select="@*"/>

          <xsl:for-each select="nsp:db">

        static private int counter = 0;

        private static synchronized int count() {
          return counter++;



  <xsl:template match="nsp:count">

  <xsl:template match="@*|*|text()|processing-instruction()">
      <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>



View raw message