[OpenLayers-Dev] Bug in OpenLayers/Format/WFS.js ?? and Fix

Stephen Woodbridge woodbri at swoodbridge.com
Tue Feb 26 20:53:01 EST 2008

Hi Tim,

Thank you for opening the ticket, I will read the links on creating 
patches and attach one.

I need some additional help, as I think there is another problem with 
the wfs insert, only I do not know much about GML and WFS-T XML so it 
might be my lack of understanding.

Sorry to paste the chuck of XML below, but it was generated by 
OpenLayers with the fix below incorporated and it is needed to discuss 
this issue. There is one each Update, Delete and Insert transaction. It 
seems to me that the Insert transaction is missing some needed nodes in 
the XML.

Notice that Update and Delete both have typeName="Geofence" on their 
respective wfs:Update and wfs:Delete tags, but there is none on the 
wfs:Insert tag! This is needed to construct the feature:<typeName> tags 
in the wfs:Insert transactions. Likewise, wfs:Update has 
<wfs:Name>the_geom</wfs:Name> which is also missing from wfs:Insert and 
is needed to construct the <feature:the_geom> tag. Maybe these problems 
are because the namespace is not setup correctly for the wfs:Insert 

I would appreciate your time to look at this issue and thoughts. I 
almost have a working demo. I can hack the PHP parser and handler to 
hard these values, but it would be much better to resolve the issues for 
the future.

   -Steve W.

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" version="1.0.0" 
   <wfs:Update typeName="Geofence">
         <gml:Polygon xmlns:gml="http://www.opengis.net/gml">
               <gml:coordinates decimal="." cs="," ts=" 
">-119.460938,45.608398 -121.746094,45.608398 -121.921875,44.290039 
-120.515625,42.268554875 -118.845703,44.37793 
     <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
       <ogc:FeatureId fid="9"/>
   <wfs:Delete typeName="Geofence">
     <ogc:Filter xmlns:ogc="http://www.opengis.net/ogc">
       <ogc:FeatureId fid="25"/>
         <gml:MultiPolygon xmlns:gml="http://www.opengis.net/gml">
                   <gml:coordinates decimal="." cs="," ts=" 
">-110.056640625,46.3115234375 -110.232421875,44.3779296875 
-106.8046875,43.8505859375 -107.595703125,47.5419921875 

Tim Schaub wrote:
> Hey-
> Stephen Woodbridge wrote:
>> Stephen Woodbridge wrote:
>>> Hi all,
>>> I ran into a strange case of the namespace for WFS being set wrong. I 
>>> think the fix follows based on reading the code. I have not had a chance 
>>> to patch and test it:
>>> http://trac.openlayers.org/browser/trunk/openlayers/lib/OpenLayers/Format/WFS.js 
>>> rev.6313
>>> L192: 	        var deleteNode = this.createElementNS(this.featureNS, 
>>> 'wfs:Delete');
>>> should be:
>>>   	        var deleteNode = this.createElementNS(this.wfsns, 'wfs:Delete');
>> Just verified that it fixes the problem that I was seeing.
> Thanks for the report.  This looks like a clear typo.
> Adding a ticket to trac with a patch is the fastest way to get something 
> fixed.
> Please see http://trac.openlayers.org/wiki/FilingTickets which includes 
> a link to http://trac.openlayers.org/wiki/CreatingPatches.
> I've set up a ticket to address this:
> http://trac.openlayers.org/ticket/1394
> Tim
>> -Steve
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
>> !DSPAM:4033,47c4654115605210051143!
> _______________________________________________
> Dev mailing list
> Dev at openlayers.org
> http://openlayers.org/mailman/listinfo/dev

More information about the Dev mailing list