mapfish / mapfish-print

A component of MapFish for printing templated cartographic maps. This module is the Java serverside module.
http://mapfish.github.io/mapfish-print-doc/
BSD 2-Clause "Simplified" License
186 stars 416 forks source link

MapFish doesn't render HTML legend titles properly #65

Open jonathan-wcc opened 11 years ago

jonathan-wcc commented 11 years ago

I have a SLD with a definition of:

<?xml version="1.0" encoding="UTF-8"?>

se:NameA&E Hospitals/se:Name se:FeatureTypeStyle se:Rule se:PointSymbolizer se:Graphic se:ExternalGraphic se:Formatimage/png/se:Format /se:ExternalGraphic se:Size26/se:Size /se:Graphic /se:PointSymbolizer /se:Rule /se:FeatureTypeStyle

Because it's XML, it needs to have the & down as & (as I've done here). MFP 2.0 doesn't seem to realise this and renders it as & rather than &.

jbjonesjr commented 11 years ago

jonathan, mark-down destroyed what you pasted. you can please share your sld again, this time in some sort of markdown wrapper that won't remove your special characters?

jonathan-wcc commented 11 years ago

HI Jamie, Sorry about that. I hate systems that try to be "smart" (i.e. by deducing markdown/up) - they're invariably not.

Github won't let me attach it (images only it seems). I've put it here: https://docs.google.com/file/d/0B22cYd3gwE-6ZUpITFF4OS1oV0k/edit?usp=sharing

geekdenz commented 11 years ago

A good place to paste code is http://pastebin.com/.

Alternatively, in GitHub you can do (3 back ticks followed directly by xml):


<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xsi:schemaLocation="http://www.opengis.net/sld http://schemas.opengis.net/sld/1.1.0/StyledLayerDescriptor.xsd" xmlns:se="http://www.opengis.net/se">
  <NamedLayer>
    <se:Name>A&amp;E Hospitals</se:Name>
    <UserStyle>
      <se:FeatureTypeStyle>
        <se:Rule>
          <se:PointSymbolizer>
            <se:Graphic>
              <se:ExternalGraphic>
                <se:OnlineResource xlink:type="simple" xlink:href="file:///d:/GeoServer_Config_Dir/symbology/OpenIcons_PNG/hospital.png"/>
                <se:Format>image/png</se:Format>
              </se:ExternalGraphic>
              <se:Size>26</se:Size>
            </se:Graphic>
          </se:PointSymbolizer>
        </se:Rule>
      </se:FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

end with 3 back ticks (https://help.github.com/articles/github-flavored-markdown#fenced-code-blocks).

jonathan-wcc commented 11 years ago

Interesting. That's the file anyway.

Relating to the ticket, it seems github is trying to outwit us - basically MFP is printing & amp; (sans space) instead of just a plain &.