diff --git a/src/ol/xml.js b/src/ol/xml.js index e491d16454..908b2e9516 100644 --- a/src/ol/xml.js +++ b/src/ol/xml.js @@ -48,6 +48,15 @@ ol.xml.getAllTextContent_ = function(node, normalizeWhitespace, accumulator) { }; +/** + * @param {string} xml XML. + * @return {Document} Document. + */ +ol.xml.load = function(xml) { + return new DOMParser().parseFromString(xml, 'application/xml'); +}; + + /** * @param {function(this: T, Node, Array.<*>): (Array.<*>|undefined)} * valueReader Value reader.