[Mapserver-dev] Re: [Mapserver-users] HTML characters in template

Steve Lime steve.lime at dnr.state.mn.us
Fri Jan 10 01:53:10 EST 2003


I moved the encode and decode functions to mapstring.c. I also added the
encoding as the default processing for accessing attributes in
templates. Seems to make sense since that's how most people would expect
it to work. However, sometimes you want raw, unaltered data (i.e. if you
store HTML in the database) so I added a [itemname_raw] substitution to
get at that presentation. All bases should be covered.

Thanks for the function Dan...

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> Daniel Morissette <morissette at dmsolutions.ca> 01/09/03 10:19 AM >>>
Steve Lime wrote:
> 
> Yup, but I'm not sure it fixes your problem. The _esc replacement is
> basically there so you could escape data for inclusion in other URLs.
> Special characters are replaced with their hexidecimal ascii codes so
a
> space becomes %20 and so on. I think what you want is html escapes and
> we'd need to add that, probably as another substitution qualifier:
> 
>   [variable_html] or something like that
> 

FYI I've written a function msEncodeHTMLEntities() in mapows.c that is
used in the WMS/WFS stuff.  It is also used in mapgml.c to encode
attribute values.

Perhaps the function could be moved to mapstring.c or a more generic
location and you could use it for this. Other than that it is ready to
use.

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the mapserver-dev mailing list