2015-08-16 06:59:58 +00:00
|
|
|
define( [
|
2013-09-09 01:05:07 +00:00
|
|
|
"../core"
|
|
|
|
], function( jQuery ) {
|
|
|
|
|
2016-04-25 18:25:08 +00:00
|
|
|
"use strict";
|
|
|
|
|
2013-09-09 15:39:02 +00:00
|
|
|
// Cross-browser xml parsing
|
|
|
|
jQuery.parseXML = function( data ) {
|
2014-11-12 10:29:41 +00:00
|
|
|
var xml;
|
2013-09-09 15:39:02 +00:00
|
|
|
if ( !data || typeof data !== "string" ) {
|
|
|
|
return null;
|
|
|
|
}
|
2013-09-09 01:05:07 +00:00
|
|
|
|
2019-04-29 20:56:09 +00:00
|
|
|
// Support: IE 9 - 11+
|
2016-02-25 00:18:55 +00:00
|
|
|
// IE throws on parseFromString with invalid input.
|
2013-09-09 15:39:02 +00:00
|
|
|
try {
|
2014-09-11 20:18:34 +00:00
|
|
|
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
|
2013-09-09 15:39:02 +00:00
|
|
|
} catch ( e ) {
|
|
|
|
xml = undefined;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
|
|
|
|
jQuery.error( "Invalid XML: " + data );
|
|
|
|
}
|
|
|
|
return xml;
|
|
|
|
};
|
|
|
|
|
|
|
|
return jQuery.parseXML;
|
2013-09-09 01:05:07 +00:00
|
|
|
|
2015-08-16 06:59:58 +00:00
|
|
|
} );
|