From 591a6cd9d2384f160a66e1d02b2f6f1c48da834c Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Tue, 4 Feb 2014 15:18:41 +0100 Subject: [PATCH] Add ol.xml.load --- src/ol/xml.js | 9 +++++++++ 1 file changed, 9 insertions(+) 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.