1YUI.add('datatype-xml-parse', function (Y, NAME) { 2 3/** 4 * Parse XML submodule. 5 * 6 * @module datatype-xml 7 * @submodule datatype-xml-parse 8 * @for XML 9 */ 10 11Y.mix(Y.namespace("XML"), { 12 /** 13 * Converts data to type XMLDocument. 14 * 15 * @method parse 16 * @param data {String} Data to convert. 17 * @return {XMLDocument} XML Document. 18 */ 19 parse: function(data) { 20 var xmlDoc = null, win; 21 if (typeof data === "string") { 22 win = Y.config.win; 23 if (win.ActiveXObject !== undefined) { 24 xmlDoc = new ActiveXObject("Microsoft.XMLDOM"); 25 xmlDoc.async = false; 26 xmlDoc.loadXML(data); 27 } else if (win.DOMParser !== undefined) { 28 xmlDoc = new DOMParser().parseFromString(data, "text/xml"); 29 } else if (win.Windows !== undefined) { 30 xmlDoc = new Windows.Data.Xml.Dom.XmlDocument(); 31 xmlDoc.loadXml(data); 32 } 33 } 34 35 if (xmlDoc === null || xmlDoc.documentElement === null || xmlDoc.documentElement.nodeName === "parsererror") { 36 } 37 38 return xmlDoc; 39 } 40}); 41 42// Add Parsers shortcut 43Y.namespace("Parsers").xml = Y.XML.parse; 44 45Y.namespace("DataType"); 46Y.DataType.XML = Y.XML; 47 48 49}, 'patched-v3.18.1');
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.