#894 - bind this to xmldom closure

git-svn-id: http://svn.openlayers.org/trunk/openlayers@3875 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2007-08-08 16:19:31 +00:00
parent d5da925ffc
commit 1ecede4e16
2 changed files with 32 additions and 5 deletions
+4 -2
View File
@@ -62,7 +62,7 @@ OpenLayers.Format.XML.prototype =
text = text.substring(index);
}
var node = OpenLayers.Util.Try(
function() {
(function() {
var xmldom;
/**
* Since we want to be able to call this method on the prototype
@@ -72,10 +72,11 @@ OpenLayers.Format.XML.prototype =
xmldom = new ActiveXObject("Microsoft.XMLDOM");
} else {
xmldom = this.xmldom;
}
xmldom.loadXML(text);
return xmldom;
},
}).bind(this),
function() {
return new DOMParser().parseFromString(text, 'text/xml');
},
@@ -180,6 +181,7 @@ OpenLayers.Format.XML.prototype =
if(node.getElementsByTagNameNS) {
elements = node.getElementsByTagNameNS(uri, name);
} else {
// brute force method
var allNodes = node.getElementsByTagName("*");
var potentialNode, fullName;
for(var i=0; i<allNodes.length; ++i) {