I load XML from aspx page by MSXML2.DOMDOCUMENT.3.0 ActiveXObject.
var xmlDoc = null;
try {
xmlDoc = new ActiveXObject("MSXML2.DOMDocument.3.0");
xmlDoc.setProperty("SelectionLanguage", "XPath");
}
catch (e) {
window.alert("CreateXMLDocument failed due to the following problem: " + e.description);
}
if (xmlDoc != null) {
xmlDoc.async = false;**
var result = xmlDoc.load("xmlData.aspx");
if (result == false) {
window.alert("failed to load xml due to the following problem: " + xmlDoc.parseError.Reason);
}
else {
window.alert(xmlDoc.selectSingleNode("//RESULT").text);
}
}
aspx page that provides xml data:
<%@ Page Language = "JScript" EnableSessionState="ReadOnly" %>
<% Response.Buffer = true %>
<%
Response.ContentType = "text/xml";
Response.Write("<?xml version='1.0'?>");
Response.Write("<RESULT>1</RESULT>");
%>
Any idea about this?
UPDATE: I figured out that XMLDOM could not load xml synchronously from https in IE9, and then used XMLHTTP to load xml with no problems. But now the problem is XMLHTTP-loaded xslt could not be used to transform xml.
UPDATE AGAIN: It's not correct to say that XML DOM could not load xml synchronously from https in IE9. In IE9 Internet Options --> Advanced --> Security --> "Do not save encrypted pages to disk", if you have it checked, the issue occurs. Uncheck it, problem is solved.
You should read this for an explanation: