1 function Sys$Net$XMLHttpExecutor$get_xml() {
3 if (arguments.length !== 0) throw Error.parameterCount();
4 if (!this._responseAvailable) {
5 throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_xml'));
6 }
7 if (!this._xmlHttpRequest) {
8 throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_xml'));
9 }
10 var xml = this._xmlHttpRequest.responseXML;
11 if (!xml || !xml.documentElement) {
12 xml = Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);
13 if (!xml || !xml.documentElement)
14 return null;
15 }
16 else if (navigator.userAgent.indexOf('MSIE') !== -1) {
17 xml.setProperty('SelectionLanguage', 'XPath');
18 }
19 if (xml.documentElement.namespaceURI === "http://www.mozilla.org/newlayout/xml/parsererror.xml" &&
20 xml.documentElement.tagName === "parsererror") {
21 return null;
22 }
23
24 if (xml.documentElement.firstChild && xml.documentElement.firstChild.tagName === "parsererror") {
25 return null;
26 }
27
28 return xml;
29 }