Internet Explorer/Microsoft.XMLDOM escaping quotes?
I'm trying to get a SOAP related script working in Firefox and IE. It works fine in Firefox, but I'm getting an error server side when I send the message. I'm still trying to figure out how to see the incoming message on the server side, but in the meantime, I noticed that when my script reads in a file over http from Firefox, it looks fine:
While I notice the firefox version lacks the '?xml? header, it works. On the other hand, Internet explorer has escaped out all of the double quotes. I'm guessing this is what my server side code is objecting to. Is there a way to prevent XMLDOM from doing this?
Here is how I load my xml docs:
Code:
getXmlDocObject : function() {
var xmlDoc = false;
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
//code for Mozilla, Firefox, Opera, etc.
else if (document.implementation
&& document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
return xmlDoc;
},
loadXmlDoc : function (url) {
var xmlDoc = this.getXmlDocObject();
xmlDoc.async=false;
xmlDoc.load(url);
return xmlDoc;
},
So it turns out the escaped-quotes are an internal representation only. My problem was that the XML transform was putting an encoding type in the xml prolog which did not reflect the encoding used in the HTTP POST of the message. I strip out the prolog before sending the message now.
Bookmarks