cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vadim.gritse...@verizon.net>
Subject RE: Servlet to XSL possible?
Date Thu, 24 Jan 2002 16:39:53 GMT
Bob,

Did you EVER tried to access http://cb:8080/cocoon/servlet23/BobServlet?

Vadim

> From: Bob Garvey [mailto:bobgarvey2@home.com]
> 
> Sorry it took so long to respond.
> The servlet works. Yes.
> But the output never hits cocoon so the sitemap entry is never
operative.
> The response is returned to the requestor like David mentioned.
> Frankly the capability of outputting from a servlet to an XSL process
is the
> first that I thought of the Cocoon2 should be good at.  So I have been
> suprised that others have not talked about it.
> 
> Bob Garvey
> 
> ----- Original Message -----
> From: "Vadim Gritsenko" <vadim.gritsenko@verizon.net>
> To: <cocoon-users@xml.apache.org>; "'Bob Garvey'"
<bgarvey@wordgraph.com>
> Sent: Wednesday, January 23, 2002 2:44 PM
> Subject: RE: Servlet to XSL possible?
> 
> 
> > Bob,
> >
> > Hey, stop right here... Your servlet works, right? Invoking:
> >
> > http://cb:8080/examples/servlet/servlet23.BobServlet
> >
> > should return XML from your servlet, right?
> > Then next step: pipe servlet output into Coocon. You have Cocoon
> > deployed in tomcat under, say, cocoon:
> >
> > http://cb:8080/cocoon/welcome
> >
> > Now, you have sitemap entry:
> >
> > <map:match pattern="servlet23/*">
> >   <map:generate
src="http://cb:8080/examples/servlet/servlet23.{1}"/>
> >   <map:transform src="stylesheets/test.xsl"/>
> >   <map:serialize/>
> > </map:match>
> >
> > Did you EVER tried to access
> >
> > http://cb:8080/cocoon/servlet23/BobServlet
> >
> > ???
> >
> > If yes, what is the output?
> >
> > Regards,
> > Vadim
> >
> >
> > > -----Original Message-----
> > > From: Bob Garvey [mailto:bobgarvey2@home.com]
> > > Sent: Wednesday, January 23, 2002 2:27 PM
> > > To: cocoon-users@xml.apache.org
> > > Subject: Re: Servlet to XSL possible?
> > >
> > > David,
> > >     Thanks for your thoughts.  I am going to digest what you
suggest
> > > further.  I think another approach that is clean, albeit no
Cocoon, is
> > to
> > > leave it as a servlet, and use xalan directly - something like:
> > >
> > >       // instantiate a TransformerFactory
> > >       javax.xml.transform.TransformerFactory tFactory =
> > >
javax.xml.transform.TransformerFactory.newInstance();
> > >
> > >       // ?? somehow attach a StringBuffer to the source instead of
a
> > file
> > >       javax.xml.transform.Source xmlSource =
> > >                 new javax.xml.transform.stream.StreamSource
> > >                              (new
> > > java.net.URL("file:foo.xml").openStream());
> > >
> > >       // write all the XML to a/the StringBuffe here ........
> > >
> > >       // set the style sheet source
> > >       javax.xml.transform.Source xslSource =
> > >                 new javax.xml.transform.stream.StreamSource
> > >                              (new
> > > java.net.URL("file:foo.xsl").openStream());
> > >
> > >       // Generate (instantiate) the transformer.
> > >       javax.xml.transform.Transformer transformer =
> > >                              tFactory.newTransformer(xslSource);
> > >
> > >       // Perform the transformation, sending the output to the
> > response.
> > >       transformer.transform(xmlSource,
> > >                            new
> > > javax.xml.transform.stream.StreamResult(out));
> > >
> > > Bob Garvey
> > >
> >
> > <snip/>
> >
> >
> >
---------------------------------------------------------------------
> > 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