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 ) {
|
|
|
|
var xml, tmp;
|
|
|
|
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 {
|
|
|
|
tmp = new DOMParser();
|
2013-09-11 01:08:01 +00:00
|
|
|
xml = tmp.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
|
|
|
|
|
|
|
});
|