cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James & Sue Ann Birchfield" <jsrbi...@home.com>
Subject Servlets and Dynamic XML
Date Fri, 10 Dec 1999 03:47:03 GMT
I am looking for a simple Hello World to get me started.  I
was hoping I might be able to get away with the following code, but
I knew it wouldn't fly, and it doesn't:

import javax.servlet.*;
import javax.servlet.http.*;

import java.util.*;
import java.io.*;


public class XmlServlet extends HttpServlet {

	public void doGet(HttpServletRequest req, HttpServletResponse res)
		throws IOException {

		res.setContentType("text/xml");
		PrintWriter out = res.getWriter();
		out.println("<?xml version=\"1.0\"?>");
		out.println("<?xml-stylesheet href=\"http://24.3.47.214/hello.xsl\"
type=\"text/xsl\"?>");
		out.println("<?cocoon-process type=\"xslt\"?>");
		out.println("<page>");
		out.println(" <title>Hello</title>");
		out.println(" <content>");
		out.println("  <paragraph>This is my first Cocoon file!</paragraph>");
		out.println(" </content>");
		out.println("</page>");
		out.flush();
	}
}

So, to do the equivalent of the same, what needs to be done?  I have read
briefly about
producers, and am thinking they are the answer.  Can any one provide me, and
others possibly,
a 'Hello World' example for using dynamic XML and Cocoon within a servlet?

Thanks!!!
James Birchfield


Mime
View raw message