Return-Path: Mailing-List: contact cocoon-users-help@xml.apache.org; run by ezmlm Delivered-To: mailing list cocoon-users@xml.apache.org Received: (qmail 87343 invoked from network); 18 Sep 2000 20:13:14 -0000 Received: from unknown (HELO ussmcb01.nthincubator.com) (208.30.188.2) by locus.apache.org with SMTP; 18 Sep 2000 20:13:14 -0000 Subject: Robin? Re: How to Call Servlets, CGIs on your server and other servers; Servlet Chaining To: cocoon-users@xml.apache.org, greenrd@hotmail.com Cc: cocoon-users@xml.apache.org, stefano@apache.org Bcc: X-Mailer: Lotus Notes Release 5.0.3 March 21, 2000 Message-ID: From: Eliza.Khosrova@tminus10.com Date: Mon, 18 Sep 2000 13:13:10 -0700 X-MIMETrack: Serialize by Router on USSMCB01/Nthincubator(Release 5.0.3 |March 21, 2000) at 09/18/2000 01:13:15 PM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Robin, Thanks for your response. I just had one more question that I was wondering if you can help me. My servlet is outputting an XML tree as a big XML string. Specifically, it will return a string containing the following: ... ... ... ... .... I would like to embed the above XML tree in my XSP page where I called the servlet. Is there a way I can convert the XML string to XML node in my XSP page after getting it from my servlet? I am assuming another way would be to have my servlet dump XML node and not string. If so, are there some documentation or sample codes on how to create and build the above node in my servlet? Also, if my servlet output the XML node, then after calling Object content = new URL ("http://...../myservlet:).getContent() in my XSP page, can I treat the content as a node and simply call xspCurrentNode.appendChild(document.importNode(node, true)); in my XSP page. Thanks in advance for your help. Below is my XSP page and my servlet. sample.xml =========== My HomePage Help help.xml About about.xml Login login.xml Register register.xml URL junk = new URL("http://localhost/servlets/GetCategories"); BufferedReader in = new BufferedReader( new InputStreamReader( junk.openStream())); String inputLine = null; while ((inputLine = in.readLine()) != null) { inputLine } in.close(); GetCategories.java servlet ======================= import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class GetCategories extends HttpServlet { public String getServletInfo() { return "Servlet to report a set of categories"; } public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { PrintWriter out; resp.setContentType("text/xml"); out = resp.getWriter(); out.println(""); out.println("Music"); out.println("contains music-related videos"); out.println(""); out.println(""); out.println("Wedding"); out.println("contains wedding-related videos"); out.println(""); out.println(""); out.println("Humor"); out.println("contains humorous videos"); out.println(""); out.println(""); out.println("Animals"); out.println("contains animals videos"); out.println(""); out.println(""); out.println("Children"); out.println("contains children videos"); out.println(""); out.println(""); out.println("Sports"); out.println("contains sports-related videos"); out.println(""); out.close(); } }