cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: How do I directly access Cocoon
Date Thu, 22 Mar 2001 16:08:58 GMT
David Cittadini wrote:
> 
> Hi,
> 
> Long story but as part of the "internal" processing of a Servlet I
> dynamically produce a DOM Document and then I want Cocoon to process this
> for me.  In C1 I could use Processor.process(Document, Environment) and that
> worked well.  However, in C2 the ability to directly pass a Document to the
> Processor has been removed.  I don't really want an external sitemap as I am
> effectively embedding the Cocoon engine directly in my code.  So, is there a
> new way to do what Processor.process(Document, Environment) could do for me
> in the past?  From what I can see I think that the answer is no.

If you have a different environment, then you would pass a URI that will
process the Generator/Transformer/Serializer in question.  What this means
is that you would have to create a new Generator that new to call back for
the DOM.  Another method, is to provide the Document object as a request
Attribute, and let your Generator process the Document object from that
attribute.

It is possible, just not as convenient.  In a high transaction environment
like a Web Server, DOM is just not scalable enough to keep up.  That's
why it is not directly supported.

> 
> Thanks, David.
> 
> -----Original Message-----
> From: Donald Ball [mailto:balld@webslingerZ.com]
> Sent: Thursday, 22 March 2001 3:17
> To: cocoon-users@xml.apache.org; David.Cittadini@blackmarble.com
> Subject: Re: How do I directly access Cocoon
> 
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> On Wed, 21 Mar 2001, David Cittadini wrote:
> 
> > I have a Servlet that produces a org.w3c.dom.Document that has the
> required
> > Cocoon processing instructions added.  How do I programmatically pass this
> > onto Cocoon 2 so that it can perform the required transformations and then
> > pass the results back to me as a String?  I figured out how to do it with
> > Cocoon 1 but I am a bit lost with Cocoon 2.
> 
> 1. you have a _servlet_ which produces DOM objects? that's weird, the
> servlet api doesn't mention DOM objects anywhere - servlets output
> streams. suggest you might refactor your DOM code into a library instead
> of a servlet.
> 
> 2. c2 doesn't rely on processing instructions in each file to control
> flow, it has a central sitemap to do that instead. suggest you read up on
> the sitemap concept (see the xdocs directory) before diving in. you can
> probably write an xsp page which calls your DOM-producing library, or
> possibly a sitemap component which does the same thing. note c2 is
> entirely SAX based, so you'll have to do some conversion.
> 
> - donald
> 
> ---------------------------------------------------------------------
> 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: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@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: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message