Add ol.xml.load

This commit is contained in:
Tom Payne
2014-02-04 15:18:41 +01:00
parent 2b268e284e
commit 591a6cd9d2

View File

@@ -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)} * @param {function(this: T, Node, Array.<*>): (Array.<*>|undefined)}
* valueReader Value reader. * valueReader Value reader.