cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James & Sue Ann Birchfield" <>
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.*;

public class XmlServlet extends HttpServlet {

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

		PrintWriter out = res.getWriter();
		out.println("<?xml version=\"1.0\"?>");
		out.println("<?xml-stylesheet href=\"\"
		out.println("<?cocoon-process type=\"xslt\"?>");
		out.println(" <title>Hello</title>");
		out.println(" <content>");
		out.println("  <paragraph>This is my first Cocoon file!</paragraph>");
		out.println(" </content>");

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?

James Birchfield

View raw message