Thanks for you help David.

It appears that in Cocoon2, you simply call

<xsp:expr>org.w3c.dom.Node</xsp:expr>

and the XSPObjectHelper.xspExpr(org.xml.sax.ContentHandler,
org.w3c.dom.Node) takes care of generating the SAX events for you.

The only problem is that now I am getting a "java.lang.AbstractMethodError"
exception as the DOM is parsed.  I suspect that this might be a classpath
problem.

...it's always something. :)

-Mitch



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

-----Original Message-----
From: David Rosenstrauch [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 1:59 PM
To: [EMAIL PROTECTED]
Subject: RE: Accessing xspCurrentNode from xsp


Best info I can find on the topic (in your cocoon docs, at e.g.,
file:///C:/java/apache-cocoon-2.0rc1a/docs/xsp-internals.html#dom-xsp):

"The new, SAX-based XSP version for Apache Cocoon 2.0 is not backwards
compatible with its DOM-based former self.

In order to protect the existing DOM-based XSP code base, a "new" markup
language will be added that simply wraps existing XSP version 1 pages,
postprocessing their generated documents to convert them into SAX events.

..."

Doesn't seem to have much info about this "new markup language" though.

Maybe someone else on this list (or the dev list) has some more info.


DR


At 01:31 PM 11/9/01 -0800, you wrote:
>Thanks David,
>
>Looking at the generated source does help.  The first thing I notice is
that
>the generated code generates SAX events using this.contentHandler.  It then
>occurred to me that Cocoon2 uses SAX instead of DOM.  As such, I suppose
>that it makes sence that there would be no 'document' object to which I
>could add nodes.  The fact that I was looking at Cocoon1 xsp documentation
>may explain my confusion.
>
>The question then becomes, how do I do something similar with Cocoon2?
>
>I have a DOM that I would like to insert into my generated XML document.
>Using the old method, I simply add my doc fragment to the XSP DOM.
>
>How do I do this with Cocoon?
>
>...any suggestions?
>
>-Mitch
>
>-----Original Message-----
>From: David Rosenstrauch [mailto:[EMAIL PROTECTED]]
>Sent: Friday, November 09, 2001 1:02 PM
>To: [EMAIL PROTECTED]
>Subject: RE: Accessing xspCurrentNode from xsp
>
>
>Yes, it's in (a long-winded dir):
>
>$TOMCAT_HOME/work/localhost/cocoon/org/apache/www/[the subdir under cocoon
>where your xsp pages are]
>
>
>DR
>
>
>At 12:42 PM 11/9/01 -0800, you wrote:
> >Is there any way to look at the generated java code?  I thought I read
>about
> >this somewhere, but I can't find it now.
> >
> >-Mitch
> >
> >-----Original Message-----
> >From: David Rosenstrauch [mailto:[EMAIL PROTECTED]]
> >Sent: Friday, November 09, 2001 11:22 AM
> >To: [EMAIL PROTECTED]
> >Subject: Re: Accessing xspCurrentNode from xsp
> >
> >
> >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: <[EMAIL PROTECTED]>
> > >For additional commands, e-mail: <[EMAIL PROTECTED]> 
> >
> >
> >---------------------------------------------------------------------
> >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: <[EMAIL PROTECTED]>
> >For additional commands, e-mail: <[EMAIL PROTECTED]>
> >
> >---------------------------------------------------------------------
> >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: <[EMAIL PROTECTED]>
> >For additional commands, e-mail: <[EMAIL PROTECTED]> 
>
>
>---------------------------------------------------------------------
>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: <[EMAIL PROTECTED]>
>For additional commands, e-mail: <[EMAIL PROTECTED]>
>
>---------------------------------------------------------------------
>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: <[EMAIL PROTECTED]>
>For additional commands, e-mail: <[EMAIL PROTECTED]> 


---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to