XML.com: XML From the Inside Out

XML.comWebServices.XML.comO'Reilly Networkoreilly.com
  Articles | Weblogs | Newsletter | Safari Bookshelf
advertisement

Article:
 Very Dynamic Web Interfaces
Subject: Microsoft.XMLHTTP vs. XMLHttpRequest
Date: 2005-07-04 06:16:42
From: chrisward1

This may be blinding obvious to everyone else - but I'd like to emphasise the importance of setting the header content type to "text/xml" if you are using the ActiveX XMLHTTP and want to get your hands on the DOM version of the returned XML.


I've spent two days trying to track down why using Opera (using XMLHttpRequest) worked but using IE 6 (using Microsoft.XMLHTTP) didn't.


My problem was that I'd done a copy/paste of an old servlet for my test and it set the content type to "text/html". In Opera this got through and the responeXML property returned with the expected DOM object, however IE6 did return the text (in the responseText property) but had a null responseXML.


So don't forget...


res.setContentType("text/xml");


... hope this helps someone out there!




Previous Message Previous Message   Next Message Next Message


Titles Only Titles Only Newest First
  • Microsoft.XMLHTTP vs. XMLHttpRequest
    2005-12-25 22:28:59 PARTHA [Reply]

    I am using Servlet and IE 6.0.x.My servlet code is as
    res.setContentType("text/xml");
    out.print("<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>");
    out.println("<message>");
    out.println("success");
    out.println("</message>");


    It is returning the result as xml and getting Data
    by req.responseText. But I am getting nothing if I use req.responseXML.I am getting Exception if I use the statement like
    var resp = req.responseXML.documentElement;
    But I have to process the result XML using DOM.How can I solve the problems.Please help me regarding this....


  • Microsoft.XMLHTTP vs. XMLHttpRequest
    2005-11-04 08:31:59 Gdawg [Reply]

    I concur with this post 100%, it cost me alot of wasted time trying to get XML to work in IE.


    If you want Cross-Browser, make sure that header is sent with your XML doc.




Sponsored By:


Contact Us | Our Mission | Privacy Policy | Advertise With Us | | Submissions Guidelines
Copyright © 2008 O'Reilly Media, Inc. | (707) 827-7000 / (800) 998-9938