cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tobias Kraft <u...@rz.uni-karlsruhe.de>
Subject dynamic XMl
Date Sun, 19 Nov 2000 19:21:19 GMT
Hi,
I want to create a dynamic XML-Stream by a Servlet and convert this
created XML-Stream to HTML by using Cocoon. I make a Forward to the
Cocoon Servlet with the getRequestDispatcher method from the
ServletContext class.
When I call the Servlet with
>   http://localhost/cocoon/MyServlet?producer=request
I get always an error like:
> You must specify a root element 

My Servlet looks like:
>  public class MyServlet extends HttpServlet {
>  ........
>    response.setContentType("text/html");
>    PrintWriter out = response.getWriter();
>  
>    out.println ("<?xml version=\"1.0\"?>");
>    out.println ("<?xml-stylesheet href=\"NameStyle.xsl\" type=\"text/xsl\"?>");
>    out.println ("<?cocoon-process type=\"xslt\"?>");
>    out.println ("<names>");
>    out.println ("<name>");
>    out.println(getFirstName());
>    out.println ("</name>");
>    out.println ("</names>");
>     
>    ServletContext context = new ServletContext();
>    //Forwarding to the Cocoon-Servlet
>    context.getRequestDispatcher(Cocoon).forward(request, response);   

Has anyone an idea for solving this problem?

Mime
View raw message