2013-09-09 01:05:07 +00:00
|
|
|
define([
|
|
|
|
"../core"
|
|
|
|
], function( jQuery ) {
|
|
|
|
|
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
|
|
|
|
2013-09-09 15:39:02 +00:00
|
|
|
// Support: IE9
|
|
|
|
try {
|
2014-11-12 10:29:41 +00:00
|
|
|
xml = ( new 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
|
|
|
|
|
|
|
});
|