You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mitchell Christensen <mc...@redknife.com> on 2001/11/09 20:12:17 UTC

Accessing xspCurrentNode from xsp

Hi,

I have searched, to no avail.  I am writing an xsp page, and attempting to
access both the document and xspCurrentNode variables in order to add nodes
to the document.  I am pulling these "other" document fragments from a
Tamino xml database.  Whenever I try to reference 'document', in my
<xsp:logic/> element, I get an 'Undefined variable: document' message during
the compilation of the xsp page.

According to the documentation at http://xml.apache.org/cocoon/xsp.html,
this should be possible.  Is this different with Cocoon2?

I am using Cocoon2 with Tomcat 3.2.3.

Any help would be greatly appreciated.
-Mitch

--------------------------
Mitch Christensen
Principal Architect
Redknife, Inc.
3095 Independence Dr.
Livermore, CA  94550


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Accessing xspCurrentNode from xsp

Posted by David Rosenstrauch <da...@dti.net>.
Maybe it's where you're referencing the document variable.  You might only be able to reference it after you output a root node.  That changes the location of where your code goes in the generated XSP file.  i.e.:

Not this:
<xsp:page
         language="java"
         xmlns:xsp="http://apache.org/xsp"
 >
         <xsp:logic> ... document ... </xsp:logic>
         <root>

This:
<xsp:page
         language="java"
         xmlns:xsp="http://apache.org/xsp"
 >
         <root>
         <xsp:logic> ... document ... </xsp:logic>


This is just off the top of my head, though, so I might be off-base.  I seem to remember having run into this before though.

HTH.


DR


At 11:12 AM 11/9/01 -0800, you wrote:
>Hi,
>
>I have searched, to no avail.  I am writing an xsp page, and attempting to
>access both the document and xspCurrentNode variables in order to add nodes
>to the document.  I am pulling these "other" document fragments from a
>Tamino xml database.  Whenever I try to reference 'document', in my
><xsp:logic/> element, I get an 'Undefined variable: document' message during
>the compilation of the xsp page.
>
>According to the documentation at http://xml.apache.org/cocoon/xsp.html,
>this should be possible.  Is this different with Cocoon2?
>
>I am using Cocoon2 with Tomcat 3.2.3.
>
>Any help would be greatly appreciated.
>-Mitch
>
>--------------------------
>Mitch Christensen
>Principal Architect
>Redknife, Inc.
>3095 Independence Dr.
>Livermore, CA  94550
>
>
>---------------------------------------------------------------------
>Please check that your question has not already been answered in the
>FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
>To unsubscribe, e-mail: <co...@xml.apache.org>
>For additional commands, e-mail: <co...@xml.apache.org> 


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>