dcsimg
Problem displaying generated XML documents in IE5.5
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Socklan_Tan
Posted On:   Sunday, September 30, 2001 06:10 AM

I have tried to generate a XML document through a Java Servlet. I get this error when IE5.5 tries to display it: Invalid at the top level of the document. Line 1, Position 5 However, when I try to display the actual XMl document in IE5.5, there is no problem. The Servlet source code is provided below (excluding the import statements) public class Test extends HttpServlet { private PrintWriter out; public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType("text/xml"); out = response.getWriter();    More>>

I have tried to generate a XML document through a Java Servlet.

I get this error when IE5.5 tries to display it:

Invalid at the top level of the document. Line 1, Position 5

However, when I try to display the actual XMl document in IE5.5, there is no problem.

The Servlet source code is provided below (excluding the import statements)

public class Test extends HttpServlet {


private PrintWriter out;


public void doGet(HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {

response.setContentType("text/xml");

out = response.getWriter();


out.println(" <?xml version="1.0" encoding="UTF-8"?>");

out.print(" ");

out.print(" ");

out.print("Hello!");

out.print(" ");

out.print(" ");


}


public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException

{

doGet(request, response);

}


}

   <<Less
About | Sitemap | Contact