Depends of the DOM implementation, some such as Xerces and MS have
mechanisms to serialize the DOM to XML, others may not.
YMMV
Kevin Jones
DevelopMentor
www.develop.com
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Mark Torr
> Sent: 26 May 2000 14:11
> To: [EMAIL PROTECTED]
> Subject: A question about JSP and XML
> Importance: High
>
>
> I am using the DOM via a JavaServer Page and need to render my output. I
> currently have the following code:
>
> <html>
> <body>
> <%@ page import="javax.xml.parsers.*"%>
> <%@ page import="org.w3c.dom.*" %>
> <%
> try {
> DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance ();
> DocumentBuilder db = dbf.newDocumentBuilder ();
> Document doc = db.newDocument ();
> Element root = doc.createElement ("mytest");
> doc.appendChild (root);
> root.appendChild (doc.createElement ("header"));
> root.appendChild (doc.createTextNode ("\n some data is text\n "));
> root.appendChild (doc.createElement ("footer"));
> } catch (Exception e) {}
> %>
> </body>
> </html>
>
> Can someone tell me how to get the document to write itself out? Or do I
> have to go through the whole tree myself?
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets