create attributes with null value for empty attribute nodes.
Original patch by milovanderlinden, simplified by tschaub. r=me (closes #1556) git-svn-id: http://svn.openlayers.org/trunk/openlayers@9179 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -558,6 +558,12 @@ OpenLayers.Format.GML = OpenLayers.Class(OpenLayers.Format.XML, {
|
||||
this.regExes.trimSpace, "");
|
||||
attributes[name] = value;
|
||||
}
|
||||
} else {
|
||||
// If child has no childNodes (grandchildren),
|
||||
// set an attribute with null value.
|
||||
// e.g. <prefix:fieldname/> becomes
|
||||
// {fieldname: null}
|
||||
attributes[child.nodeName.split(":").pop()] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user