[OpenLayers-Dev] responseText from GetFeature (WFS POST) empty with OL2.7 + Geoserver 1.7.2

Tim Schaub tschaub at opengeo.org
Wed Feb 4 11:47:06 EST 2009


Hey-

T. Vieira wrote:
> Hi,
> 
> the response contains:
> 
> xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"
> xmlns:xml=\"http://www.w3.org/XML/1998/namespace\"
> xmlns:sf=\"http://www.openplans.org/spearfish\"
> xmlns:ows=\"http://www.opengis.net/ows\"
> xmlns:gml=\"http://www.opengis.net/gml\"
> xmlns:xlink=\"http://www.w3.org/1999/xlink\">
> 

My understanding is that this is a foggy area of the XML spec.  The most 
recent spec says the xml namespace is implicitly declared - previously, 
nothing was said.  Some parsers do not do well with this attribute 
(xmlns:xml).  IE's parser is among them.

This attribute is new in GeoServer 1.7.2.  I've opened an issue there:
http://jira.codehaus.org/browse/GEOS-2606

I'll see if we can come up with a workaround on our end.

Tim

> Tiago Vieira
> 
> 
> 
> Tim Schaub wrote:
>> Hey-
>>
>> Is this on IE?
>>
>> If so, can you check whether the response has an 
>> xmlns:xml="http://www.w3.org/XML/1998/namespace" attribute at the root?
>>
>> Tim
>>
>> T. Vieira wrote:
>>> Hi,
>>>
>>> I've been developing over OL2.7 and Geoserver 1.6.2 and when i execute a
>>> GetFeature (WFS POST), the response of it comes with this information:
>>>
>>> -> response.responseText:
>>>  --> <?xml version=\"1.0\" encoding=\"UTF-8\"?><wfs:FeatureCollection
>>> numberOfFeatures=\"7\" timeStamp=\"2009-02-02T17:15:01.389Z\"
>>> xsi:schemaLocation=\"http://www.xlm.pt/cadrede_gis
>>> http://10.112.80.32:8080/Geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=.........
>>> etc;
>>>
>>> -> response.responseXML.text:
>>>  --> 108130.789724504 -44078.85197682108130.789724504
>>> -44078.851976821413701060037331900-01-01ZAntiga E7108130.789724504
>>> -44078.8519768290#FF990011teste108130.789724504
>>> -44078.85197682108152.9323
>>> .......... etc
>>>
>>>
>>> Parsing method:
>>>    var doc = response.responseXML;
>>>   if (!doc || response.fileType!="XML") {
>>>            doc = OpenLayers.parseXMLString(response.responseText);
>>>    }
>>>
>>> ..and all works fine.
>>>
>>>
>>>
>>> I upgraded to Geoserver 1.7.2 and the result is:
>>>
>>> -> response.responseText:
>>>  --> <?xml version=\"1.0\" encoding=\"UTF-8\"?><wfs:FeatureCollection
>>> numberOfFeatures=\"7\" timeStamp=\"2009-02-02T17:15:01.389Z\"
>>> xsi:schemaLocation=\"http://www.xlm.pt/cadrede_gis
>>> http://10.112.80.32:8080/Geoserver/wfs?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName=.........
>>> etc; (the same output as before)
>>>
>>> -> response.responseXML.text:
>>>  --> ""
>>>
>>> The parser fails. I can't get any information of the feature.
>>>
>>> The method "OpenLayers.parseXMLString(response.responseText);" is
>>> deprecated, so i tried with the new method (OpenLayers.Request.POST), but
>>> the responseXML.text field is still empty.
>>>
>>>
>>> Any idea what is wrong?
>>>
>>> Thanks in advanced.
>>>
>>> Tiago Vieira 
>>
>> -- 
>> Tim Schaub
>> OpenGeo - http://opengeo.org
>> Expert service straight from the developers.
>> _______________________________________________
>> Dev mailing list
>> Dev at openlayers.org
>> http://openlayers.org/mailman/listinfo/dev
>>
>>
> 


-- 
Tim Schaub
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Dev mailing list