MapServer / MapServer-import

3 stars 2 forks source link

Ability to quote single quotes and double quotes #2262

Closed mapserver-bot closed 12 years ago

mapserver-bot commented 12 years ago

Reporter: aboudreault Date: 2011/03/01 - 15:29 At the moment, there is no way to use the ' or " characters in a mapfile string. This ticket is to add that ability to our mapfile parser as we did for MapServer expression.

mapserver-bot commented 12 years ago

Author: aboudreault Date: 2011/03/02 - 15:42 Steve, I did a patch for that ticket... but I'm not very familiar with flex/bison. The parser works... but I'm getting a few bad behavior. Do you think you could check my lexer code and see how we could fix it?

mapserver-bot commented 12 years ago

Author: aboudreault Date: 2011/03/02 - 20:28 Here's my patch. The logic seems to work... based on my printf in the mapfile.c:getString() method but something seems to be incorrect. if you try a simple getmap of gmap75.map, you should see the error. Let me know what you think.

mapserver-bot commented 12 years ago

Author: sdlime Date: 2011/03/03 - 06:23 Cool, will take a look...

Steve

mapserver-bot commented 12 years ago

Author: aboudreault Date: 2011/03/17 - 17:17 Fixed and committed in (r11194). We are now able to escape single and double quotes inside a string and a logical expression. Here's a few valid examples:

NAME "ROAD'" # single quote doesn't need to be quoted inside double quotes
NAME 'ROAD"' # double quote doesn't need to be quoted inside single quotes
NAME 'ROAD\"' # but they can....

NAME "RO\"AD" # double quote inside a a double quote delimited string
NAME 'RO\AD' # single quote inside a a single quote delimited string

FILTER 'aitkin'i # normal insensitive string
FILTER ('[CTY_NAME]' = 'Ita\'sca') # logical expression that contains a single quote
mapserver-bot commented 12 years ago

Author: aboudreault Date: 2011/03/17 - 18:22 oups, the line

NAME 'RO\AD' # single quote inside a a single quote delimited string

should be

NAME 'RO\'AD' # single quote inside a a single quote delimited string

I had forgotten the quote.

mapserver-bot commented 12 years ago

Author: dmorissette Date: 2011/03/17 - 19:53 Reopening: we probably need to document this somewhere?

mapserver-bot commented 12 years ago

Author: havatv Date: 2011/06/30 - 13:32 I intend to include this in the expressions document [http://www.mapserver.org/mapfile/expressions.html]. I hope that is OK. Where else should it be mentioned?

mapserver-bot commented 12 years ago

Author: havatv Date: 2011/06/30 - 13:59 I have now updated the expressions document http://www.mapserver.org/mapfile/expressions.html, and close this ticket. Please reopen if more needs to be done.