Add ol.xml.isNode

This commit is contained in:
Tom Payne
2014-02-04 15:42:38 +01:00
parent cd7df92891
commit d2b7ab697f

View File

@@ -77,6 +77,33 @@ ol.xml.isDocument = goog.userAgent.IE ?
ol.xml.isDocumentIE_ : ol.xml.isDocument_;
/**
* @param {?} value Value.
* @private
* @return {boolean} Is node.
*/
ol.xml.isNode_ = function(value) {
return value instanceof Node;
};
/**
* @param {?} value Value.
* @private
* @return {boolean} Is node.
*/
ol.xml.isNodeIE_ = function(value) {
return goog.isObject(value) && goog.isDef(value.nodeType);
};
/**
* @param {?} value Value.
* @return {boolean} Is node.
*/
ol.xml.isNode = goog.userAgent.IE ? ol.xml.isNodeIE_ : ol.xml.isNode_;
/**
* @param {string} xml XML.
* @return {Document} Document.