cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Painter-Wakefield" <>
Subject Re: [c1] xsp:logic compiling
Date Fri, 03 Aug 2001 14:04:50 GMT


is the code you've submitted from a logicsheet?  What does your XML file
look like?  If you are trying to run your XML through a stylesheet, and
then through the XSP processor, as it appears you might be doing, then you
need to rethink your approach.  For more info on logicsheets and how they
work in 1.8.2, see (yes
it is in the Cocoon 2 docs, but it was really written for Cocoon 1).

Based on your current code, the main thing I would suggest is putting
<xsp:content>...</xsp:content> around your <html> nodes.


Please respond to

To:   <>

Subject:  [c1] xsp:logic compiling

I'm fairly new to Cocoon - but I've been muddling through it now for a few
days.  But I'm hoping this isn't too big of a newbie question, but I didn't
find any answers in the mailing list archives, the newsgroups, or the web.

* Cocoon 1.8.2 with Tomcat

I've created an XSL file which is working fine so far (it's a basic login)
with it's XML instance document counterpart.  When the user submit a
login/pw form, it submits back to the same XML file (which in my case is
index.xml).  Here's a quick snip of the XSL code:

  <xsl:template match="page">
    <xsp:page language="java"

What I want to do is fairly simple.  Check to see if the form has been
submitted, by checking for the "login" parameter.  So here is what I
the code to:

  <xsl:template match="page">
    <xsp:page language="java"
    if (request.getParameter("login.x") == null) {
    .... the rest of the HTML which shows the login form ....
    } else {
    ... check username exists, etc

The problem seems to be how Cocoon is generating the java code.  It seems
though if I put the <xsp:logic> tags before the <html> tag it puts the code
outside of any method in the /* User Class Declarations */ part which is,
course, not valid Java syntax if I'm doing an "if" statement.

If I move the <xsp:logic> after the <html> tag my if statement goes into
populateDocument() method (which is OK - but after an HTML tag has been
to the browser I can no longer redirect).

Can anyone give me a suggestion on how I should handle the redirects??

Also, how "full-featured" is Cocoon2?  It looks as though C2 has some nifty
logicsheets for request and response objects (of which, by the way, it
as though I can use the request logicsheet in C1 and
seems to still work fine... <response> on the other hand does not).  With
those logic sheets I could just use an <xsl:choose> on the parameter and
then send the redirect.

I'm working on a live site for a client though, so stability is an

Anyways, any help would be appreciated, thanks,

- Brent

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message