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)
Change History (10)
comment:1 by , 13 years ago
by , 13 years ago
Attachment: | quotes.patch added |
---|
comment:2 by , 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:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
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 , 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 , 13 years ago
Cc: | added |
---|---|
Component: | MapServer C Library → MapServer Documentation |
Resolution: | fixed |
Status: | closed → reopened |
Reopening: we probably need to document this somewhere?
comment:7 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | reopened → new |
comment:8 by , 13 years ago
Cc: | added |
---|---|
Owner: | changed from | to
Status: | new → assigned |
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 , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.
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?