Format.WMSGetFeatureInfo: also parse empty elements, p=me,r=erilem (closes #2867)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11688 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -230,12 +230,14 @@ OpenLayers.Format.WMSGetFeatureInfo = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
var child = children[i];
|
||||
if (child.nodeType == 1) {
|
||||
var grandchildren = child.childNodes;
|
||||
if (grandchildren.length == 1) {
|
||||
var name = (child.prefix) ?
|
||||
child.nodeName.split(":")[1] : child.nodeName;
|
||||
if (grandchildren.length == 0) {
|
||||
attributes[name] = null
|
||||
} else if (grandchildren.length == 1) {
|
||||
var grandchild = grandchildren[0];
|
||||
if (grandchild.nodeType == 3 ||
|
||||
grandchild.nodeType == 4) {
|
||||
var name = (child.prefix) ?
|
||||
child.nodeName.split(":")[1] : child.nodeName;
|
||||
var value = grandchild.nodeValue.replace(
|
||||
this.regExes.trimSpace, "");
|
||||
attributes[name] = value;
|
||||
|
||||
Reference in New Issue
Block a user