Opened 13 years ago

Closed 13 years ago

#3706 closed enhancement (fixed)

Ability to quote single quotes and double quotes

Reported by: aboudreault Owned by: havatv
Priority: normal Milestone: 6.0 release
Component: Documentation - MapServer Version: unspecified
Severity: normal Keywords:
Cc: dmorissette, sdlime, aboudreault, jmckenna, havatv

Description

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.

Attachments (1)

quotes.patch (3.5 KB ) - added by aboudreault 13 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by aboudreault, 13 years ago

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?

by aboudreault, 13 years ago

Attachment: quotes.patch added

comment:2 by aboudreault, 13 years ago

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.

comment:3 by sdlime, 13 years ago

Cool, will take a look...

Steve

comment:4 by aboudreault, 13 years ago

Resolution: fixed
Status: newclosed

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

comment:5 by aboudreault, 13 years ago

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.

comment:6 by dmorissette, 13 years ago

Cc: aboudreault jmckenna added
Component: MapServer C LibraryMapServer Documentation
Resolution: fixed
Status: closedreopened

Reopening: we probably need to document this somewhere?

comment:7 by dmorissette, 13 years ago

Owner: changed from aboudreault to jmckenna
Status: reopenednew

comment:8 by havatv, 13 years ago

Cc: havatv added
Owner: changed from jmckenna to havatv
Status: newassigned

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?

comment:9 by havatv, 13 years ago

Resolution: fixed
Status: assignedclosed

I have now updated the expressions document http://www.mapserver.org/mapfile/expressions.html (r11858), and close this ticket. Please reopen if more needs to be done.

Note: See TracTickets for help on using tickets.