1 import { jQuery } from "../core.js";
3 // Cross-browser xml parsing
4 jQuery.parseXML = function( data ) {
5 var xml, parserErrorElem;
6 if ( !data || typeof data !== "string" ) {
10 // Support: IE 9 - 11+
11 // IE throws on parseFromString with invalid input.
13 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
16 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
17 if ( !xml || parserErrorElem ) {
18 jQuery.error( "Invalid XML: " + (
20 jQuery.map( parserErrorElem.childNodes, function( el ) {
21 return el.textContent;