September 13th, 2002, 09:49 AM
I am trying to ouput some xml onto my Browser (IE 6) and my code reads like this:
PrintWriter out = response.getWriter();
out.print("<?xml version='1.0' encoding='ISO-8859-1'?>");
out.print(" Hello, World!!!!!!!");
Pretty simple u cud say.. but what happens is the servlet somehow parses the xml and prints only the values between the tags greeting!!
However if i do a view source on the browser the xml tags are visible fine!!
Any ideas why the xml tags dont appear on the browser??
September 14th, 2002, 10:52 PM
Try "text/xml" or "application/xml" instead of just "xml" for your mime type. The problem isn't with the servlet, the problem is the browser interpreting your content as html or xhtml and trying to display the contents without the markup.
September 16th, 2002, 04:46 AM
i originially tried with text/xml but wouldnt work either...
furtehr whats strange is that i closed the browser window and opened it again and voila the xml showed up allright but the same problem occured a few mins later!!
an more suggestion???