cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Rosenstrauch <dar...@dti.net>
Subject Re: SV: What is Cocoon good for???
Date Tue, 13 Nov 2001 15:03:12 GMT
Look at the source code that comes with cocoon.  Location:  src/org/apache/cocoon/generation

Take a look at DirectoryGenerator, StatusGenerator, etc.  You can probably copy half of what
they've done in one of these classes.

Basically, what you're trying to do is call methods on the ContentHandler.  Not that hard.


DR

P.S.  You could have looked this up yourself.



At 04:01 PM 11/13/01 -0800, you wrote:
>Eeeh... Where do I find info on how to write a Generator? All I can find is
>the API, which tells me I only have to implement one method (generate).
>
>/Soren
>
>-----Oprindelig meddelelse-----
>Fra: Soren Neigaard [mailto:s.neigaard@mobilethink.dk]
>Sendt: 13. november 2001 15:52
>Til: cocoon-users@xml.apache.org
>Emne: SV: What is Cocoon good for???
>
>
>Theres no doubt that you are right, and I could easily see that I was using
>Cocoon in a way it wasn't intended to used in, but I couldn't see what I
>should do :) I will look into Generators right away!
>
>/Soren
>
>-----Oprindelig meddelelse-----
>Fra: David Rosenstrauch [mailto:darose@dti.net]
>Sendt: 13. november 2001 06:40
>Til: cocoon-users@xml.apache.org
>Emne: Re: What is Cocoon good for???
>
>
>At 03:33 PM 11/13/01 -0800, you wrote:
> >Ok I'm a bit frustrated right now, but nothing I do works :(
> >
> >I have tried to deliver XML from my Java method to C2 as a stream of ASCII
> >XML, as a string of ASCII XML, as a SAXSource and as a DOMSource. But to no
> >avail.
>
>
>In a nushell, what you are doing wrong:  you are trying to use Cocoon in a
>way that it was not indended.  Your message indicates this: "I have tried to
>deliver XML from my Java method to C2".  Writing an XSP page which generates
>XML from some outside source and then feeds it back is a bit beyond what XSP
>is intended to do.
>
>Take a step back and look at the C2 architecture:
>
>* Generators - produce XML (as a SAX stream), and send it to the
>transformer(s)
>
>* Transformers - modify the XML, and send it to either other transformers or
>the serializer
>
>* Serializers - modify the XML for output
>
>
>What it looks to me like you are trying to do is squeeze generator
>functionality into an XSP page.  And you're running into problems when doing
>it.
>
>So don't do it.  Write a generator that reads your Controller and generates
>a SAX stream.  Then have a stylesheet modify this stream.
>
>That's what Cocoon is good for:  generate XML, transform it, and output it.
>
>
>DR
>
>
>---------------------------------------------------------------------
>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> 


---------------------------------------------------------------------
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