[mapserver-commits] [MapServer/MapServer] 1df4a9: Expression to SLD: strip whitespace from non-strin...

Seth G noreply at github.com
Tue Dec 12 14:37:07 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/MapServer/MapServer
  Commit: 1df4a96cd53a204e93bcc73b706c06647bcaa50b
      https://github.com/MapServer/MapServer/commit/1df4a96cd53a204e93bcc73b706c06647bcaa50b
  Author: Seth G <sethg at geographika.co.uk>
  Date:   2023-12-12 (Tue, 12 Dec 2023)

  Changed paths:
    M msautotest/wxs/expected/wms_getstyles_expressions1.xml
    A msautotest/wxs/expected/wms_getstyles_expressions18.xml
    A msautotest/wxs/expected/wms_getstyles_expressions19.xml
    M msautotest/wxs/expected/wms_getstyles_expressions2.xml
    A msautotest/wxs/expected/wms_getstyles_expressions20.xml
    M msautotest/wxs/expected/wms_getstyles_expressions3.xml
    M msautotest/wxs/expected/wms_getstyles_expressions4.xml
    M msautotest/wxs/expected/wms_getstyles_expressions5.xml
    M msautotest/wxs/expected/wms_getstyles_expressions6.xml
    M msautotest/wxs/wms_styles_expressions.map
    M src/mapogcsld.cpp

  Log Message:
  -----------
  Expression to SLD: strip whitespace from non-string expressions (#6983)

Fixes #6892

Expressions are stripped of whitespace before being used as literal values in SLD expressions. 

`EXPRESSION ( [FID] > 1 And [FID] <= 10 )` will now produce:

```xml
<ogc:Filter><ogc:And><ogc:PropertyIsGreaterThan><ogc:PropertyName>FID</ogc:PropertyName>
<ogc:Literal>1</ogc:Literal>
</ogc:PropertyIsGreaterThan><ogc:PropertyIsLessThanOrEqualTo><ogc:PropertyName>FID</ogc:PropertyName>
<ogc:Literal>10</ogc:Literal></ogc:PropertyIsLessThanOrEqualTo></ogc:And></ogc:Filter>
```

Spaces at the end of strings in quotes are preserved:

` EXPRESSION ( [locationtype] = "primary location " )` will produce:

```xml
<ogc:Filter><ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName>
<ogc:Literal>primary location </ogc:Literal>
</ogc:PropertyIsEqualTo></ogc:Filter>
```

Whitespace in list expressions are also preserved. 

`EXPRESSION {primary location,secondary location }` will produce:

```xml
<ogc:Filter><ogc:Or><ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName>
<ogc:Literal>primary location</ogc:Literal></ogc:PropertyIsEqualTo>
<ogc:PropertyIsEqualTo><ogc:PropertyName>locationtype</ogc:PropertyName><ogc:Literal>secondary location </ogc:Literal></ogc:PropertyIsEqualTo>
</ogc:Or></ogc:Filter><se:PointSymbolizer>
```




More information about the MapServer-commits mailing list