[Mapserver-users] potential problem with layer names containi ng spaces
Bart van den Eijnden
bartvde at xs4all.nl
Wed Nov 19 11:36:09 PST 2003
Hi Daniel,
I agree with you that a WARNING would solve most of the potential
problems. I have filed a bug for this.
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=486
On the other hand I do not like the thought that Mapserver can produce
GML/XML which is not even well-formed XML. There should be some kind of
mechanism in my opinion that prevents a server from outputting invalid/not
well-formed XML. But perhaps this is a result of the way in which the XML
is written (as strings I suppose, without validation).
Best regards,
Bart
On Wed, 19 Nov 2003 13:49:00 -0500, Daniel Morissette
<morissette at dmsolutions.ca> wrote:
> Tom Kralidis [Burlington] wrote:
>> bartvde at xs4all.nl wrote:
>>>
>>> I have encountered a potential problem with layer names
>>> containing spaces. This will lead to invalid GML responses when
>>> requesting GetFeatureInfo in the GML format.
>>>
>>> What would be a good solution to overcome this?
>>>
>>
>>
>> This can also be painful to parse for some who wish to process
>> GetFeatureInfo responses. Suggest to abstract the GetFeatureInfo
>> reponse construct to not include data
>> as element names and / or attributes, yet values of said.
>>
>> i.e.
>>
>> <Layer name="Groningen kust vlakken 2002">
>> <Feature>
>> ...
>> </Feature>
>> </Layer>
>>
>> ..Tom
>>
>>
>
>
> But this is not valid GML, is it? We are talking about the GML response
> format. Does GML (or WFS) provide a way to support spaces in feature
> type names?
>
>>
>>
>>>> a. when parsing the mapfile make sure no spaces are contained
>>>> in layer names (or is this too rigorous for applications not using
>>>> GML?)
>>>>
>>>> b. when generating the GML for GetFeatureInfo check the layer
>>>> names or check if the generated GML is valid and well-formed? If the
>>>> GML is not valid or not well-formed it is better to generate a WMS
>>>> Exception I guess than generating invalid GML.
>>>>
>
>
> Replacing spaces with underscores in the layer names as we start
> processing a WMS request might work but could cause confusion too.
> Another important note is that this change would have to apply to the
> GetCapabilities and GetMap requests as well.
>
> Perhaps we should just add a test and a <!-- WARNING --> comment in the
> Capabilities if any layer contains spaces (the same way we produce
> warnings for other potential problems). Then it's up to the person
> setting up the server to make sure their layer names don't contain
> spaces.
>
> I think the WARNING would be the best route. If you agree then please
> file a bug and I can easily add this in version 4.1
>
> Daniel
--
More information about the MapServer-users
mailing list