Hello Maxim!

Regretfully, you're not correct here. I have been using cocoon
long and can tell that it is actually a webapp development
framework, a bit like struts or turbine...

What you suggest is just usage of xml in a servlet which also
makes sense. (But note that xsl transforms are dreadfully slow :-((

MP> Hello Di,

MP> Wednesday, February 06, 2002, 4:51:47 PM, you wrote:

DLG>> Hello,
DLG>> I'm tring to use cocoon 1.8 with tomcat.I have this problem.
DLG>> how could I receive an xml file (from a server far away) , join it with an
DLG>> xsl file and automatically generate the html using cocoon?
DLG>> where could I find a good forum of cocoon?

DLG>> Thank you
DLG>> Giovanni

MP>  I haven't drop much look to the cocoon framework, but as I realized,
MP>  it implements javx.xml.transform API to apply XSL transformations
MP>  to XML document. If so, the following code snippet could throw some
MP>  light on your problem:


MP>  1. Instantiate a TransformerFactory.
MP> TransformerFactory tFactory =  TransformerFactory.newInstance();

MP> // 2. Use the TransformerFactory to process the stylesheet Source and
MP> //    generate a Transformer.
MP> Transformer transformer = tFactory.newTransformer(new 
StreamSource("your-xsl-file.xsl"));

MP> // 3. Use the Transformer to transform an XML Source and send the output to 
HttpServletResponse object.
MP> transformer.transform(new 
javax.xml.transform.stream.StreamSource("http://yourserver/your-xml.xml";), response);

MP> Depending on what should be the logic of generating html result, you
MP> can put all this code in service() method of your servlet or made step 1)
MP> and 2) only once in the init() if your xsl stylesheet persists the same
MP> while only xml changing.

MP>  Max

MP> ___________________________________________________________________________
MP> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
MP> of the message "signoff SERVLET-INTEREST".

MP> Archives: http://archives.java.sun.com/archives/servlet-interest.html
MP> Resources: http://java.sun.com/products/servlet/external-resources.html
MP> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


MP> __________
MP> ��� ��� ������� �� ������ ���� ����? ������ ��� � ������� - http://www.newhost.ru



- Anton
[EMAIL PROTECTED]
[EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to