Improvements to the WMSGetFeatureInfo format which was not able to parse

some Mapserver responses. Thanks adube for the patch. r=me
(closes #2002)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9123 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-03-23 20:20:47 +00:00
parent 3e55ef6aa3
commit 3be75cc8d9

View File

@@ -177,27 +177,27 @@ OpenLayers.Format.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Format.XML, {
if (node && node.hasChildNodes()) {
children = node.childNodes;
n = children.length;
child = children[0];
while (child && child.nodeType != 1) {
child = child.nextSibling;
}
tagName = (child ? child.nodeName : '');
if (tagName.length > 0 && tagName.indexOf(criteria) > -1) {
for (var i = 0; i < n; i++) {
child = children[i];
if (child.nodeType == 1) {
nodes.push(child);
for(var k=0; k<n; k++){
child = children[k];
while (child && child.nodeType != 1) {
child = child.nextSibling;
k++;
}
tagName = (child ? child.nodeName : '');
if (tagName.length > 0 && tagName.indexOf(criteria) > -1) {
nodes.push(child);
} else {
matchNodes = this.getSiblingNodesByTagCriteria(
child, criteria);
if(matchNodes.length > 0){
(nodes.length == 0) ?
nodes = matchNodes : nodes.push(matchNodes);
}
}
}
else {
for (var i = 0; i < n; i++) {
matchNodes = this.getSiblingNodesByTagCriteria(
children[i], criteria);
(nodes.length == 0) ?
nodes = matchNodes : nodes.push(matchNodes);
}
}
}
return nodes;
},