Proper handling of null and undefined attribute values in WFS transactions. r=ahocevar (closes #2222)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@9615 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-08-07 22:35:55 +00:00
parent 5964a8db60
commit c1a0d405e4
2 changed files with 19 additions and 5 deletions

View File

@@ -254,9 +254,11 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
// add in attributes
for(var key in feature.attributes) {
this.writeNode(
"Property", {name: key, value: feature.attributes[key]}, node
);
if(feature.attributes[key] !== undefined) {
this.writeNode(
"Property", {name: key, value: feature.attributes[key]}, node
);
}
}
// add feature id filter
@@ -269,7 +271,9 @@ OpenLayers.Format.WFST.v1 = OpenLayers.Class(OpenLayers.Format.XML, {
"Property": function(obj) {
var node = this.createElementNSPlus("wfs:Property");
this.writeNode("Name", obj.name, node);
this.writeNode("Value", obj.value, node);
if(obj.value !== null) {
this.writeNode("Value", obj.value, node);
}
return node;
},
"Name": function(name) {