Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.window.open() with "text/XML" content

Status
Not open for further replies.

ttoomm

Technical User
Dec 30, 2007
4
0
0
US
I've got a JSP which only contains XML (XUL from Mozilla actually) apart from the directive <%@jsp page contentType=&quot;text/xml&quot;%>. When I invoke this JSP directly from the url bar of my browser (not IE, which is not XUL compliant), everything is OK. My XML is recognized and the contentType of my page (right click on the page and PageInfo) is well &quot;text/xml&quot;.

But what I do is constructing from a Javascript an XMLHttpRequest, posting it to the server and waiting for its response. When the Javascript gets the response, it opens a new window (win=document.window.open(...)) and writes the received stream in it (win.writeln(responseText)). It works fine with a HTML JSP but not with a XML JSP. Actually, the new window doesn't interpret the incoming stream like an XML (even though my JSP says &quot;<%@jsp page contentType=&quot;text/xml&quot;%>&quot; !!! ). A right click on the opened window says, via Page Info, that the contentType is &quot;text/html&quot; !!!

What do I wrong?
 
I have a similar problem. I am trying to render XML text string in a pop-up (window.open) in JavaScript. I can get text to render as text/plain or text/html but not text/xml.

Have you had any luck resolving your problem?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top