You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by David Rosenstrauch <da...@dti.net> on 2001/11/13 15:39:34 UTC

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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: Generators.. was: Re: SV: What is Cocoon good for???

Posted by David Rosenstrauch <da...@dti.net>.
I don't know if that's the official "right way to do it".

It was just MHO that the most appropriate place to feed in XML was via a generator.

Maybe some other people (including some of the Cocoon developers) can shed some additional light on this.


DR



At 07:01 PM 11/13/01 +0100, you wrote:
>On Tue, Nov 13, 2001 at 03:51:55PM -0800, Soren Neigaard wrote:
> > 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!
>
>Hmmm Generators, hmmmmmm. So you guys say, if I want eg. to feed data from
>EJBs, I should **NOT** use xsp pages to reach the EJBs, than rather write an
>EJBOutputGenerator? Is that right?
>
>Christopher
>-- 
>.Digital.Yearning.for.Networked.Assassination.and.Xenocide
>
>---------------------------------------------------------------------
>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>


Generators.. was: Re: SV: What is Cocoon good for???

Posted by Jozsa Kristof <dy...@kami.vein.hu>.
On Tue, Nov 13, 2001 at 03:51:55PM -0800, Soren Neigaard wrote:
> 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!

Hmmm Generators, hmmmmmm. So you guys say, if I want eg. to feed data from
EJBs, I should **NOT** use xsp pages to reach the EJBs, than rather write an
EJBOutputGenerator? Is that right?

Christopher
-- 
.Digital.Yearning.for.Networked.Assassination.and.Xenocide

---------------------------------------------------------------------
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: Cocoon2:XSP->Excel?

Posted by Alex Vishnev <av...@optonline.net>.
Nick,
Thanks for your comments. I did try to restart Tomcat to see if that helps,
but even after doing that the process looked hung. Can you explain what is
map:mount do? Should my map:match stanza look like this:

<map:match pattern="XMLj/DEMOj.excel">
        <map:mount uri-prefix="XMLj" src="XMLj/" reload-method="synchron"
check-reload="yes"/>
       <map:generate type="serverpages" src="docs/samples/XMLj/DEMOj.xml"/>
       <map:transform src="stylesheets/excel.xsl"/>
       <map:serialize type="excel"/>
   </map:match>

Alex

-----Original Message-----
From: Nick Entin [mailto:entin@togethersoft.com]
Sent: Wednesday, November 14, 2001 10:44 AM
To: cocoon-users@xml.apache.org
Subject: RE: Cocoon2:XSP->Excel?

Hi Alex,

I don't have hang problems, though opening Excel shows some HTML tags as
data. What I did:

- in main sitemap.xmap defined
   <map:match pattern="test/**">
    <map:mount uri-prefix="test" src="test/" reload-method="synchron"
check-reload="yes"/>
   </map:match>
- created subdir "test" (so no mixing with other stuff)
- put files from Marcelo's letter to the directory
- defined the local xmap (attached)
- opened url <host:port>/cocoon/test/excel

And it works.

Please note that sometimes after update of cocoon files (update of an
xmap file, update of compiled classes, update of an xsl), I have to
restart my tomcat - otherwise IE may load a page forever. May be it's
your case too?

Nick

> -----Original Message-----
> From: Alex Vishnev [mailto:avishnev@optonline.net]
> Sent: Wednesday, November 14, 2001 4:27 PM
> To: cocoon-users@xml.apache.org; mochoa@ieee.org
> Subject: RE: Cocoon2:XSP->Excel?
>
>
> Marcelo,
>
> Thanks for the files. BTW, there is a couple of garbage data
> lines on the bottom of source.xml. Looks like the file was
> not generated properly, or maybe the data is not in English
> and it only looks like garbage to me. In any case, just
> wanted to give you heads up on that. I did exactly as you
> outlined in your email. I copied excel.xls into stylesheets
> directory and source.xml into one of my project directory. I
> kept serializer stanza unchanged and inserted that into my
> sitemap file. I changed map:match stanza to match the
> installation keeping serializer as excel. However, I still
> get the same results, the process looks like it is hung or
> maybe just taking an extremely long time (over 5 min). Is
> this your experience as well? Anyone else is having the same problem?
>
> Alex
>
> -----Original Message-----
> From: Marcelo F. Ochoa [mailto:mochoa@ieee.org]
> Sent: Wednesday, November 14, 2001 7:18 AM
> To: cocoon-users@xml.apache.org
> Subject: Re: Cocoon2:XSP->Excel?
>
> Alex Vishnev wrote:
>
> >Marcelo,
> >I tried to configure everything that you suggested. When I
> try to open
> >DEMOj.excel (or whatever it resolves to), the browser does
> not display
> >any data. It almost looks like the process is hung. Can you
> enclose all
> >of your files? BTW, as far as I understand dbprism does not
> play a role
> >in this transformation. Is that correct?
> >
> >Alex
> >
> >
> >
>   DB Prism is custom Generaror for Cocoon2, then XSP could
> play the same role in the xml generation.
>   DB Prism returns an XML as the source.xml file attached.
>   Then is transformed by the excel.xsl stylesheet, attached too.
>   But requires the special configuration into sitemap.xmap
> file to return an correct mime type for excel.
>   The sitemap modifications are:
>    In a serializer sections:
>    <map:serializer name="excel"  mime-type="application/vnd.ms-excel"
> src="org.apache.cocoon.serialization.XMLSerializer">
>     <encoding>iso-8859-1</encoding>
>    </map:serializer>
>
>   In pipelines section:
>    <map:match pattern="xmlj/DEMOj.excel">
>     <map:generate type="db" src="/xmlj/DEMOj.excel"/>
>     <map:transform src="stylesheets/dbprism/excel.xsl"/>
>     <map:serialize type="excel"/>
>    </map:match>
>
>   Replace the pattern attribute according to your
> installation configuration and the generate type to
> serverpages type for XSP generation. Note that in this match
> section the serializer is "excel" defined into the previous part.
>   Best regards, Marcelo.
>
>
> --
> Marcelo F. Ochoa - mochoa@ieee.org
> Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
> More info? Chapter 21 of the book "Professional XML
> Databases" (Wrox Press
> http://www.wrox.com/)
> Chapter 8 of the book "Oracle & Open Source" (O'Reilly
> http://www.oreilly.com/catalog/oracleopen/)
> -----------------------------------------------
> Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
> Paraje Arroyo Seco - Campus Universitario
> (7000) Tandil - Bs. AS. - Argentina
> Te: +54-2293-444430 Fax: +54-2293-444431
>
>
>
>
> ---------------------------------------------------------------------
> 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>


RE: Cocoon2:XSP->Excel?

Posted by Nick Entin <en...@togethersoft.com>.
Hi Alex,

I don't have hang problems, though opening Excel shows some HTML tags as
data. What I did:

- in main sitemap.xmap defined
   <map:match pattern="test/**">
    <map:mount uri-prefix="test" src="test/" reload-method="synchron"
check-reload="yes"/>
   </map:match>
- created subdir "test" (so no mixing with other stuff)
- put files from Marcelo's letter to the directory
- defined the local xmap (attached)
- opened url <host:port>/cocoon/test/excel

And it works.

Please note that sometimes after update of cocoon files (update of an
xmap file, update of compiled classes, update of an xsl), I have to
restart my tomcat - otherwise IE may load a page forever. May be it's
your case too?

Nick

> -----Original Message-----
> From: Alex Vishnev [mailto:avishnev@optonline.net]
> Sent: Wednesday, November 14, 2001 4:27 PM
> To: cocoon-users@xml.apache.org; mochoa@ieee.org
> Subject: RE: Cocoon2:XSP->Excel?
> 
> 
> Marcelo,
> 
> Thanks for the files. BTW, there is a couple of garbage data
> lines on the bottom of source.xml. Looks like the file was 
> not generated properly, or maybe the data is not in English 
> and it only looks like garbage to me. In any case, just 
> wanted to give you heads up on that. I did exactly as you 
> outlined in your email. I copied excel.xls into stylesheets 
> directory and source.xml into one of my project directory. I 
> kept serializer stanza unchanged and inserted that into my 
> sitemap file. I changed map:match stanza to match the 
> installation keeping serializer as excel. However, I still 
> get the same results, the process looks like it is hung or 
> maybe just taking an extremely long time (over 5 min). Is 
> this your experience as well? Anyone else is having the same problem?
> 
> Alex
> 
> -----Original Message-----
> From: Marcelo F. Ochoa [mailto:mochoa@ieee.org]
> Sent: Wednesday, November 14, 2001 7:18 AM
> To: cocoon-users@xml.apache.org
> Subject: Re: Cocoon2:XSP->Excel?
> 
> Alex Vishnev wrote:
> 
> >Marcelo,
> >I tried to configure everything that you suggested. When I
> try to open
> >DEMOj.excel (or whatever it resolves to), the browser does
> not display
> >any data. It almost looks like the process is hung. Can you
> enclose all
> >of your files? BTW, as far as I understand dbprism does not
> play a role
> >in this transformation. Is that correct?
> >
> >Alex
> >
> >
> >
>   DB Prism is custom Generaror for Cocoon2, then XSP could
> play the same role in the xml generation.
>   DB Prism returns an XML as the source.xml file attached.
>   Then is transformed by the excel.xsl stylesheet, attached too.
>   But requires the special configuration into sitemap.xmap 
> file to return an correct mime type for excel.
>   The sitemap modifications are:
>    In a serializer sections:
>    <map:serializer name="excel"  mime-type="application/vnd.ms-excel"
> src="org.apache.cocoon.serialization.XMLSerializer">
>     <encoding>iso-8859-1</encoding>
>    </map:serializer>
> 
>   In pipelines section:
>    <map:match pattern="xmlj/DEMOj.excel">
>     <map:generate type="db" src="/xmlj/DEMOj.excel"/>
>     <map:transform src="stylesheets/dbprism/excel.xsl"/>
>     <map:serialize type="excel"/>
>    </map:match>
> 
>   Replace the pattern attribute according to your
> installation configuration and the generate type to 
> serverpages type for XSP generation. Note that in this match 
> section the serializer is "excel" defined into the previous part.
>   Best regards, Marcelo.
> 
> 
> --
> Marcelo F. Ochoa - mochoa@ieee.org
> Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
> More info? Chapter 21 of the book "Professional XML 
> Databases" (Wrox Press
> http://www.wrox.com/)
> Chapter 8 of the book "Oracle & Open Source" (O'Reilly
> http://www.oreilly.com/catalog/oracleopen/)
> -----------------------------------------------
> Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
> Paraje Arroyo Seco - Campus Universitario
> (7000) Tandil - Bs. AS. - Argentina
> Te: +54-2293-444430 Fax: +54-2293-444431
> 
> 
> 
> 
> ---------------------------------------------------------------------
> 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: Cocoon2:XSP->Excel?

Posted by Alex Vishnev <av...@optonline.net>.
Marcelo,

Thanks for the files. BTW, there is a couple of garbage data lines on the
bottom of source.xml. Looks like the file was not generated properly, or
maybe the data is not in English and it only looks like garbage to me. In
any case, just wanted to give you heads up on that. I did exactly as you
outlined in your email. I copied excel.xls into stylesheets directory and
source.xml into one of my project directory. I kept serializer stanza
unchanged and inserted that into my sitemap file. I changed map:match stanza
to match the installation keeping serializer as excel. However, I still get
the same results, the process looks like it is hung or maybe just taking an
extremely long time (over 5 min). Is this your experience as well? Anyone
else is having the same problem?

Alex

-----Original Message-----
From: Marcelo F. Ochoa [mailto:mochoa@ieee.org]
Sent: Wednesday, November 14, 2001 7:18 AM
To: cocoon-users@xml.apache.org
Subject: Re: Cocoon2:XSP->Excel?

Alex Vishnev wrote:

>Marcelo,
>I tried to configure everything that you suggested. When I try to open
>DEMOj.excel (or whatever it resolves to), the browser does not display any
>data. It almost looks like the process is hung. Can you enclose all of your
>files? BTW, as far as I understand dbprism does not play a role in this
>transformation. Is that correct?
>
>Alex
>
>
>
  DB Prism is custom Generaror for Cocoon2, then XSP could play the same
role in the xml generation.
  DB Prism returns an XML as the source.xml file attached.
  Then is transformed by the excel.xsl stylesheet, attached too.
  But requires the special configuration into sitemap.xmap file to
return an correct mime type for excel.
  The sitemap modifications are:
   In a serializer sections:
   <map:serializer name="excel"  mime-type="application/vnd.ms-excel"
src="org.apache.cocoon.serialization.XMLSerializer">
    <encoding>iso-8859-1</encoding>
   </map:serializer>

  In pipelines section:
   <map:match pattern="xmlj/DEMOj.excel">
    <map:generate type="db" src="/xmlj/DEMOj.excel"/>
    <map:transform src="stylesheets/dbprism/excel.xsl"/>
    <map:serialize type="excel"/>
   </map:match>

  Replace the pattern attribute according to your installation
configuration and the generate type to serverpages type for XSP
generation. Note that in this match section the serializer is "excel"
defined into the previous part.
  Best regards, Marcelo.


--
Marcelo F. Ochoa - mochoa@ieee.org
Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
More info?
Chapter 21 of the book "Professional XML Databases" (Wrox Press
http://www.wrox.com/)
Chapter 8 of the book "Oracle & Open Source" (O'Reilly
http://www.oreilly.com/catalog/oracleopen/)
-----------------------------------------------
Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
Paraje Arroyo Seco - Campus Universitario
(7000) Tandil - Bs. AS. - Argentina
Te: +54-2293-444430 Fax: +54-2293-444431




---------------------------------------------------------------------
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: Cocoon2:XSP->Excel?

Posted by "Marcelo F. Ochoa" <mo...@ieee.org>.
Alex Vishnev wrote:

>Marcelo,
>I tried to configure everything that you suggested. When I try to open
>DEMOj.excel (or whatever it resolves to), the browser does not display any
>data. It almost looks like the process is hung. Can you enclose all of your
>files? BTW, as far as I understand dbprism does not play a role in this
>transformation. Is that correct?
>
>Alex
>
> 
>
  DB Prism is custom Generaror for Cocoon2, then XSP could play the same 
role in the xml generation.
  DB Prism returns an XML as the source.xml file attached.
  Then is transformed by the excel.xsl stylesheet, attached too.
  But requires the special configuration into sitemap.xmap file to 
return an correct mime type for excel.
  The sitemap modifications are:
   In a serializer sections:
   <map:serializer name="excel"  mime-type="application/vnd.ms-excel"  
src="org.apache.cocoon.serialization.XMLSerializer">
    <encoding>iso-8859-1</encoding>
   </map:serializer>

  In pipelines section:
   <map:match pattern="xmlj/DEMOj.excel">
    <map:generate type="db" src="/xmlj/DEMOj.excel"/>
    <map:transform src="stylesheets/dbprism/excel.xsl"/>
    <map:serialize type="excel"/>
   </map:match>

  Replace the pattern attribute according to your installation 
configuration and the generate type to serverpages type for XSP 
generation. Note that in this match section the serializer is "excel" 
defined into the previous part.
  Best regards, Marcelo.
   

-- 
Marcelo F. Ochoa - mochoa@ieee.org
Do you Know DB Prism? Look @ http://www.plenix.com/dbprism/
More info?
Chapter 21 of the book "Professional XML Databases" (Wrox Press 
http://www.wrox.com/)
Chapter 8 of the book "Oracle & Open Source" (O'Reilly 
http://www.oreilly.com/catalog/oracleopen/)
-----------------------------------------------
Lab. de Sistemas - Fac. de Cs. Exactas - UNICEN
Paraje Arroyo Seco - Campus Universitario
(7000) Tandil - Bs. AS. - Argentina
Te: +54-2293-444430 Fax: +54-2293-444431




Re: Cocoon2:XSP->Excel?

Posted by Alex Vishnev <av...@optonline.net>.
Marcelo,
I tried to configure everything that you suggested. When I try to open
DEMOj.excel (or whatever it resolves to), the browser does not display any
data. It almost looks like the process is hung. Can you enclose all of your
files? BTW, as far as I understand dbprism does not play a role in this
transformation. Is that correct?

Alex


---------------------------------------------------------------------
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: SV: What is Cocoon good for???

Posted by David Rosenstrauch <da...@dti.net>.
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: <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>
>
>
>
>
>---------------------------------------------------------------------
>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>


RE: What is Cocoon good for???

Posted by Karl Oie <ka...@gan.no>.
http://cvs.apache.org/viewcvs.cgi/xml-cocoon2/src/org/apache/cocoon/generati
on/

you should start out with taking a good look at FileGenerator.java and
StreamGenerator.java , analyzing these you will soon find out how you could
create your own generator and add it to the sitemap.

and yes, David Rosenstrauch is right, you should really do a generator
instead :-)

mvh karl oie


-----Original Message-----
From: Soren Neigaard [mailto:s.neigaard@mobilethink.dk]
Sent: 14. november 2001 01:02
To: cocoon-users@xml.apache.org
Subject: SV: What is Cocoon good for???


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




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


SV: What is Cocoon good for???

Posted by Soren Neigaard <s....@mobilethink.dk>.
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: <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>




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


SV: What is Cocoon good for???

Posted by Soren Neigaard <s....@mobilethink.dk>.
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: <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>