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

2001-11-14 Thread David Rosenstrauch

I would imagine that SAX would perform much better:

* Doesn't need to build a DOM tree in memory, so less memory usage

* Doesn't need to wait till the DOM tree is built; can start processing from the first 
root element


DR


At 03:43 PM 11/14/01 -0800, you wrote:
>Yes I think so too, but it also works for me if just return a
>org.w3c.dom.Node to C2, and since my controller works with XML internally
>this is a smooth solution I think :) However I dont know if you solution has
>better performance, so I might just convert to your solution anyway. Does
>anybody know which solution performs better?
>
>/Soren
>
>-Oprindelig meddelelse-
>Fra: Karl Oie [mailto:[EMAIL PROTECTED]]
>Sendt: 14. november 2001 06:07
>Til: [EMAIL PROTECTED]
>Emne: RE: Generators.. was: Re: SV: What is Cocoon good for???
>
>
>thank you, very enlighting! :-D i think this is the answer to Soren Neigards
>problems with SAX yesterday!
>
>mvh karl oie
>
>
>
>-Original Message-
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>Sent: 14. november 2001 15:00
>To: [EMAIL PROTECTED]
>Subject: RE: Generators.. was: Re: SV: What is Cocoon good for???
>
>
>Here's the xsp page:
>
>
>
>   language="java"
>   xmlns:xsp="http://apache.org/xsp";
> >
>  
>   net.securinet.jbxsp.*
>   org.apache.cocoon.environment.http.*
>  
>  
>  
>  
>   
> 
>  
>
> 
>   
>
>
>**
>
>As you see, it includes my library (net.securinet.jbxsp.*) and the cocoon
>http environment stuff. It then instantiates a Jbxsp (java bean xsp) class
>with the name of the component class (SAX and DOM aware). The whole thing
>is then asked to toSAX itself. This causes the Jbxsp class to ask the named
>class to toSAX itself, which (as an awt container) asks its components to
>do the same - thus building the tree.
>
>In other words, in order to get a named component (or the main class you
>instantiate) to generate SAX (or DOM) events is to do you xml file reading
>in the constructor, or in the toSAX method of that class.
>
>eg (forgive if that doesn't work without my libs - it just shows how I play
>with these issues). I suspect this also shows why a custom generator might
>be more useful in your case, as you'd have to analyse your xml doc into its
>constituent parts in order to output it again as SAX events (although I'm
>sure there's an easy way to achieve this).
>
> public void toSAX(ContentHandler handler) {
> try{
> this.contentHandler = handler;
> AttributesImpl atts = new AttributesImpl();
> start("jbxsp-id", atts);
> characters("" + instanceId);
> end("jbxsp-id");
>
> start("jbxsp-screen-id", atts);
> characters("" + screenId);
> end("jbxsp-screen-id");
>
> start("jbxsp-screen", atts);
> characters("" + screenClass);
> end("jbxsp-screen");
>
> start("jbxsp-trail", atts);
> characters("" + trail.getTrailId());
> end("jbxsp-trail");
>
> } catch(Exception e){
> System.err.println("Error in SAX (toSAX) ");
> e.printStackTrace();
> }
>
> instance.toSAX(handler);
>//System.out.println("Finished converting to DOM");
> }
>
>
>
>
>
>
>
>Karl Oie <[EMAIL PROTECTED]> on 14/11/2001 12:57:36
>
>Please respond to [EMAIL PROTECTED]
>
>To:   [EMAIL PROTECTED]
>cc:
>Subject:  RE: Generators.. was: Re: SV: What is Cocoon good for???
>
>
> >I'm happy to share some code with you if you need it.
> >
> >Regards,
> >
> >Anthony Aldridge
> >Lead Application developer
>
>
>please do, as i find working examples a great way to learn! :-)
>
>mvh karl oie
>
>-
>Please check that your question has not already been answered in the
>FAQ before posting. 
>
>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. 
>
>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. 
>
>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. 
>
>To unsubscribe, e-mail: <[EMAIL PROTECTED]>
>For additional commands, e-mail: <[EMAIL PROTECT

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

2001-11-14 Thread Soren Neigaard

Yes I think so too, but it also works for me if just return a
org.w3c.dom.Node to C2, and since my controller works with XML internally
this is a smooth solution I think :) However I dont know if you solution has
better performance, so I might just convert to your solution anyway. Does
anybody know which solution performs better?

/Soren

-Oprindelig meddelelse-
Fra: Karl Oie [mailto:[EMAIL PROTECTED]]
Sendt: 14. november 2001 06:07
Til: [EMAIL PROTECTED]
Emne: RE: Generators.. was: Re: SV: What is Cocoon good for???


thank you, very enlighting! :-D i think this is the answer to Soren Neigards
problems with SAX yesterday!

mvh karl oie



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 14. november 2001 15:00
To: [EMAIL PROTECTED]
Subject: RE: Generators.. was: Re: SV: What is Cocoon good for???


Here's the xsp page:



http://apache.org/xsp";
>
 
  net.securinet.jbxsp.*
  org.apache.cocoon.environment.http.*
 
 
 
 
  

 


  


**

As you see, it includes my library (net.securinet.jbxsp.*) and the cocoon
http environment stuff. It then instantiates a Jbxsp (java bean xsp) class
with the name of the component class (SAX and DOM aware). The whole thing
is then asked to toSAX itself. This causes the Jbxsp class to ask the named
class to toSAX itself, which (as an awt container) asks its components to
do the same - thus building the tree.

In other words, in order to get a named component (or the main class you
instantiate) to generate SAX (or DOM) events is to do you xml file reading
in the constructor, or in the toSAX method of that class.

eg (forgive if that doesn't work without my libs - it just shows how I play
with these issues). I suspect this also shows why a custom generator might
be more useful in your case, as you'd have to analyse your xml doc into its
constituent parts in order to output it again as SAX events (although I'm
sure there's an easy way to achieve this).

public void toSAX(ContentHandler handler) {
try{
this.contentHandler = handler;
AttributesImpl atts = new AttributesImpl();
start("jbxsp-id", atts);
characters("" + instanceId);
end("jbxsp-id");

start("jbxsp-screen-id", atts);
characters("" + screenId);
end("jbxsp-screen-id");

start("jbxsp-screen", atts);
characters("" + screenClass);
end("jbxsp-screen");

start("jbxsp-trail", atts);
characters("" + trail.getTrailId());
end("jbxsp-trail");

} catch(Exception e){
System.err.println("Error in SAX (toSAX) ");
e.printStackTrace();
}

instance.toSAX(handler);
   //System.out.println("Finished converting to DOM");
}







Karl Oie <[EMAIL PROTECTED]> on 14/11/2001 12:57:36

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  RE: Generators.. was: Re: SV: What is Cocoon good for???


>I'm happy to share some code with you if you need it.
>
>Regards,
>
>Anthony Aldridge
>Lead Application developer


please do, as i find working examples a great way to learn! :-)

mvh karl oie

-
Please check that your question has not already been answered in the
FAQ before posting. 

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. 

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. 

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. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




Re: What is Cocoon good for???

2001-11-13 Thread Piroumian, Konstantin

>>This is done to allow Cocoon 2 to run in any environment and not only
>>servlet container. C2 can be used also in any other environment, e.g.:
>>command line (this one is implemented), EJB (this one is possible,
>>although
>>I've never heard of implementations).
>
>Extending from a class doesn't bind it to the class's original intended use
>does it? I thought "javax.servlet.http.HttpServletRequest" was an
>interface, it doesn't rely on anything.

This is a question to cocoon-dev mail list.
There were some proposals from Berin about redesigning Cocoon as a
GenericServlet and use javax.servlet.* interfaces (and not
javax.servlet.http.*). Also, the separation of interfaces and implemenations
to jars was discussed, but it seems that it has been forgotten.
See cocoon-dev archives.

>Regards,
>
>Anthony Aldridge
>Lead Application developer
>
>Managed Intranet Hosting
>CSC
>JPMorganChase
>Personal GDP: 325-8338
>MIH Hotline: 876-1300



-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




Re: What is Cocoon good for???

2001-11-13 Thread aaldridg

>This is done to allow Cocoon 2 to run in any environment and not only
>servlet container. C2 can be used also in any other environment, e.g.:
>command line (this one is implemented), EJB (this one is possible,
although
>I've never heard of implementations).

Extending from a class doesn't bind it to the class's original intended use
does it? I thought "javax.servlet.http.HttpServletRequest" was an
interface, it doesn't rely on anything.

>This is intentionally! The core Cocoon engine is not bound to the Servlet
API,
>thus we introduced an abstract Environment to design a general
Request/Response
>model. If we will bind Cocoon to the Servlet API the engine isn't easy
portable
>to other environments like Commandline, Maillet, etc.

Importing another .jar file for the interface doesn't seem overly
inconvinient considering the number of jars already being imnported.

Regards,

Anthony Aldridge
Lead Application developer

Managed Intranet Hosting
CSC
JPMorganChase
Personal GDP: 325-8338
MIH Hotline: 876-1300





"Piroumian, Konstantin" <[EMAIL PROTECTED]> on 13/11/2001 15:19:28

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  Re: What is Cocoon good for???


This is done to allow Cocoon 2 to run in any environment and not only
servlet container. C2 can be used also in any other environment, e.g.:
command line (this one is implemented), EJB (this one is possible, although
I've never heard of implementations).

Regards,
Konstantin Piroumain

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 5:58 PM
Subject: Re: What is Cocoon good for???


I too wonder why "org.apache.cocoon.environment.Request" mimics but doesn't
extend "javax.servlet.http.HttpServletRequest". Isn't that what objects are
for?

Regards,

Anthony Aldridge
Lead Application developer

Managed Intranet Hosting
CSC
JPMorganChase
Personal GDP: 325-8338
MIH Hotline: 876-1300





Søren Neigaard <[EMAIL PROTECTED]> on 13/11/2001 23:33:29

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  What is Cocoon good for???


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. Yes I know that I probably havent done the last two attempts
correctly, but I cant figure out how to do it, and I cant find any info
that
might help me, and the first two attempte should work according to the info
I have found on Apache's C2 site (but it dont).

If I return a stream/string of ACSII XML data to C2, it works just fine on
the first URL I call (no matter how many times i call it), but if I call
another URL which doest EXCATLY the same as the first (same logicsheet,
same
namespace) it dosn't work. BUT If I had called the last URL first, it
would have bene the one to work, and number one URL would fail!??? What is
this?? Thats just impossible to work with :(

Oh yes... Then there's the "org.apache.cocoon.environment.Request". Whats
that then?? Why not keep it as "javax.servlet.http.HttpServletRequest" so
others can work with it without binding their code to C2.

Ok you guys, don't take this as a flame or anything like that. You have
been
super to help me, I'm just so damn tired off Cocoon, and I just neede to
blow off some steam. It may sound stupid, but I really needed to send this
mail, or I'm afraid I might go crazy :)

Med venlig hilsen/Best regards
Søren Neigaard
System Architect

Mobilethink A/S
Arosgaarden
Åboulevarden 23, 5.sal
DK - 8000 Århus C
Telefon: +45 86207800
Direct: +45 86207810
Fax: +45 86207801
Email: [EMAIL PROTECTED]
Web: www.mobilethink.dk



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








--

Re: What is Cocoon good for???

2001-11-13 Thread Giacomo Pati

Quoting Søren Neigaard <[EMAIL PROTECTED]>:

> 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. Yes I know that I probably havent done the last two attempts
> correctly, but I cant figure out how to do it, and I cant find any info
> that
> might help me, and the first two attempte should work according to the
> info
> I have found on Apache's C2 site (but it dont).

Sorry, I can't help you out here (no experience).

> If I return a stream/string of ACSII XML data to C2, it works just fine
> on
> the first URL I call (no matter how many times i call it), but if I call
> another URL which doest EXCATLY the same as the first (same logicsheet,
> same
> namespace) it dosn't work. BUT If I had called the last URL first,
> it
> would have bene the one to work, and number one URL would fail!??? What
> is
> this?? Thats just impossible to work with :(
> 
> Oh yes... Then there's the "org.apache.cocoon.environment.Request".
> Whats
> that then?? Why not keep it as "javax.servlet.http.HttpServletRequest"
> so
> others can work with it without binding their code to C2.

This is intentionally! The core Cocoon engine is not bound to the Servlet API, 
thus we introduced an abstract Environment to design a general Request/Response 
model. If we will bind Cocoon to the Servlet API the engine isn't easy portable 
to other environments like Commandline, Maillet, etc.

> Ok you guys, don't take this as a flame or anything like that. You have
> been
> super to help me, I'm just so damn tired off Cocoon, and I just neede to
> blow off some steam. 

I hope you feel better now :)

> It may sound stupid, but I really needed to send
> this
> mail, or I'm afraid I might go crazy :)

Giacomo

-
Please check that your question has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




Re: What is Cocoon good for???

2001-11-13 Thread Piroumian, Konstantin

This is done to allow Cocoon 2 to run in any environment and not only
servlet container. C2 can be used also in any other environment, e.g.:
command line (this one is implemented), EJB (this one is possible, although
I've never heard of implementations).

Regards,
Konstantin Piroumain

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 5:58 PM
Subject: Re: What is Cocoon good for???


I too wonder why "org.apache.cocoon.environment.Request" mimics but doesn't
extend "javax.servlet.http.HttpServletRequest". Isn't that what objects are
for?

Regards,

Anthony Aldridge
Lead Application developer

Managed Intranet Hosting
CSC
JPMorganChase
Personal GDP: 325-8338
MIH Hotline: 876-1300





Søren Neigaard <[EMAIL PROTECTED]> on 13/11/2001 23:33:29

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  What is Cocoon good for???


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. Yes I know that I probably havent done the last two attempts
correctly, but I cant figure out how to do it, and I cant find any info
that
might help me, and the first two attempte should work according to the info
I have found on Apache's C2 site (but it dont).

If I return a stream/string of ACSII XML data to C2, it works just fine on
the first URL I call (no matter how many times i call it), but if I call
another URL which doest EXCATLY the same as the first (same logicsheet,
same
namespace) it dosn't work. BUT If I had called the last URL first, it
would have bene the one to work, and number one URL would fail!??? What is
this?? Thats just impossible to work with :(

Oh yes... Then there's the "org.apache.cocoon.environment.Request". Whats
that then?? Why not keep it as "javax.servlet.http.HttpServletRequest" so
others can work with it without binding their code to C2.

Ok you guys, don't take this as a flame or anything like that. You have
been
super to help me, I'm just so damn tired off Cocoon, and I just neede to
blow off some steam. It may sound stupid, but I really needed to send this
mail, or I'm afraid I might go crazy :)

Med venlig hilsen/Best regards
Søren Neigaard
System Architect

Mobilethink A/S
Arosgaarden
Åboulevarden 23, 5.sal
DK - 8000 Århus C
Telefon: +45 86207800
Direct: +45 86207810
Fax: +45 86207801
Email: [EMAIL PROTECTED]
Web: www.mobilethink.dk



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




Re: What is Cocoon good for???

2001-11-13 Thread aaldridg

I too wonder why "org.apache.cocoon.environment.Request" mimics but doesn't
extend "javax.servlet.http.HttpServletRequest". Isn't that what objects are
for?

Regards,

Anthony Aldridge
Lead Application developer

Managed Intranet Hosting
CSC
JPMorganChase
Personal GDP: 325-8338
MIH Hotline: 876-1300





Søren Neigaard <[EMAIL PROTECTED]> on 13/11/2001 23:33:29

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:
Subject:  What is Cocoon good for???


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. Yes I know that I probably havent done the last two attempts
correctly, but I cant figure out how to do it, and I cant find any info
that
might help me, and the first two attempte should work according to the info
I have found on Apache's C2 site (but it dont).

If I return a stream/string of ACSII XML data to C2, it works just fine on
the first URL I call (no matter how many times i call it), but if I call
another URL which doest EXCATLY the same as the first (same logicsheet,
same
namespace) it dosn't work. BUT If I had called the last URL first, it
would have bene the one to work, and number one URL would fail!??? What is
this?? Thats just impossible to work with :(

Oh yes... Then there's the "org.apache.cocoon.environment.Request". Whats
that then?? Why not keep it as "javax.servlet.http.HttpServletRequest" so
others can work with it without binding their code to C2.

Ok you guys, don't take this as a flame or anything like that. You have
been
super to help me, I'm just so damn tired off Cocoon, and I just neede to
blow off some steam. It may sound stupid, but I really needed to send this
mail, or I'm afraid I might go crazy :)

Med venlig hilsen/Best regards
Søren Neigaard
System Architect

Mobilethink A/S
Arosgaarden
Åboulevarden 23, 5.sal
DK - 8000 Århus C
Telefon: +45 86207800
Direct: +45 86207810
Fax: +45 86207801
Email: [EMAIL PROTECTED]
Web: www.mobilethink.dk



-
Please check that your question has not already been answered in the
FAQ before posting. 

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. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>




RE: What is Cocoon good for???

2001-11-13 Thread Karl Oie

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:[EMAIL PROTECTED]]
Sent: 14. november 2001 01:02
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sendt: 13. november 2001 15:52
Til: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]]
Sendt: 13. november 2001 06:40
Til: [EMAIL PROTECTED]
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: <[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]>




Re: What is Cocoon good for???

2001-11-13 Thread David Rosenstrauch

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. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>