[mapserver-users] About html code inside query attribute responses

Lime, Steve D (DNR) Steve.Lime at state.mn.us
Wed Mar 16 13:05:54 EDT 2011


Can you or someone else share a sample shapefile with HTML in an attribute? I've not experienced this problem but donw have access to a datafile with that type of content...

Steve
________________________________________
From: mapserver-users-bounces at lists.osgeo.org [mapserver-users-bounces at lists.osgeo.org] On Behalf Of Manuel Aymerich [maymerich at argongra.es]
Sent: Tuesday, March 15, 2011 10:04 AM
To: mapserver-users at lists.osgeo.org
Cc: Lime, Steve D (DNR)
Subject: RE: [mapserver-users] About html code inside query attribute responses

Thanks Steve.

As you already pointed out [item name=”name” escape=”none”] behaves exactly as [name_raw], which in my case translates html tags from <…> to &lt;br&gt . Not a really coherent behavior, is it?

Manuel

De: Lime, Steve D (DNR) [mailto:Steve.Lime at state.mn.us]
Enviado el: lunes, 14 de marzo de 2011 16:46
Para: Manuel Aymerich; mapserver-users at lists.osgeo.org
Asunto: RE: [mapserver-users] About html code inside query attribute responses

What you describe is basically correct. Except, there is no code in place to translate html elements like you mention with [attribute item name_raw]. That should be the correct method of telling MapServer not to touch the contents of an attribute at all. You could also try:

  [item name=”name” escape=”none”]

That should generate the same output as [name_raw] and is the preferred way of doing this sort of thing.

Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Manuel Aymerich
Sent: Monday, March 14, 2011 10:18 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] About html code inside query attribute responses

Hi,

I’ve prepared WMS getFeautreInfo queries so that mapserver’s template receives pure html attributes (containing the <br> tag for example). I would like to show this html code as it is. So that it integrates with the existing html header, footer and the rest of the template inside mapservers response, hoping that at the frontend the html response could be interpreted as a whole. However, the html stored data is shown either as escaped html or as url encoded data. I’ver read mapserver documentation but I had not success while implementing each possible solution:

If I try:

[attribute name] : I get escaped html (<br> is translated into &lt;br&gt;)
[attrribute name_esc]: I get url encdes text (<br> is translated into %3Cbr%2F%3)
[attribute item name_raw]: I get something in between but not pure html (<br> is translated into \n).

Mapserver documentation says “…By default the attributes are encoded especially for HTML representation” but I now disagree.

Any ideas about what’s happening here? Any workaround solutions?

Thanks in advance,

Manuel Aymerich
________________________________

Se certificó que el correo no contiene virus.
Comprobada por AVG - www.avg.es<http://www.avg.es>
Versión: 10.0.1204 / Base de datos de virus: 1498/3505 - Fecha de la versión: 13/03/2011




More information about the mapserver-users mailing list