You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Arnaud de la Sudrie <ad...@phonevalley.com> on 2001/05/09 14:35:32 UTC

cocoon and servlet

does anybody could tell me how to launch cocoon from a servlet. I want to
transform an xml document (generated dynamically) with an xslt.
thanks

	Arnaud de La Sudrie


---------------------------------------------------------------------
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: cocoon and servlet

Posted by Arnaud de la Sudrie <ad...@phonevalley.com>.
Yes but Xalan does not load a XSLT dynamically by User-Agent.

-----Message d'origine-----
De : forge@neonics.com [mailto:forge@neonics.com]
Envoye : mercredi 9 mai 2001 18:07
A : cocoon-users@xml.apache.org
Objet : Re: cocoon and servlet




On Wed, 9 May 2001, Arnaud de la Sudrie wrote:

> does anybody could tell me how to launch cocoon from a servlet. I want to
> transform an xml document (generated dynamically) with an xslt.
> thanks

If that's all you want don't use Cocoon. Just go to xml.apache.org
and download xalan. There are plenty of examples to transform an xml
document with xslt, the simplest example being:

import javax.xml.transform.*;
import javax.xml.transform.sax.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;

                        
TransformerFactory tf=TransformerFactory.newInstance();
Transformer transformer=tf.newTransformer(new StreamSource(xslfilename))
transformer.transform(new StreamSource(xmlfilename), new
				StreamResult("out.html"));


Of course you should alter the streams..

Good luck!


> 
> 	Arnaud de La Sudrie
> 
> 
> ---------------------------------------------------------------------
> 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: cocoon and servlet

Posted by fo...@neonics.com.

On Wed, 9 May 2001, Arnaud de la Sudrie wrote:

> does anybody could tell me how to launch cocoon from a servlet. I want to
> transform an xml document (generated dynamically) with an xslt.
> thanks

If that's all you want don't use Cocoon. Just go to xml.apache.org
and download xalan. There are plenty of examples to transform an xml
document with xslt, the simplest example being:

import javax.xml.transform.*;
import javax.xml.transform.sax.*;
import javax.xml.transform.dom.*;
import javax.xml.transform.stream.*;

                        
TransformerFactory tf=TransformerFactory.newInstance();
Transformer transformer=tf.newTransformer(new StreamSource(xslfilename))
transformer.transform(new StreamSource(xmlfilename), new
				StreamResult("out.html"));


Of course you should alter the streams..

Good luck!


> 
> 	Arnaud de La Sudrie
> 
> 
> ---------------------------------------------------------------------
> 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: cocoon and servlet

Posted by Arnaud Vandyck <ar...@ressource-toi.org>.
On Wed, 9 May 2001, Arnaud de la Sudrie wrote:

> does anybody could tell me how to launch cocoon from a servlet. I want to
> transform an xml document (generated dynamically) with an xslt.
> thanks

Maybe you do not need Cocoon to accomplish that... the transformation  can
be made with xalan or any other parser... except if you want other  cocoon
features... there are some transformation examples in xalan documentation.

Hope it helps.

--
Arnaud Vandyck <http://www.ressource-toi.org/>

"(7 mai 2001) 0.3.3  Chapitre 1 presque parfait."
- http://bibliocosme.com/actualite.html




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