<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
FYI, those are called Byte-Order-Markers (or BOM):<br>
<a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Byte-order_mark">http://en.wikipedia.org/wiki/Byte-order_mark</a><br>
<br>
IMO, all applications should be able to handle such markers, but not
all do.<br>
If you have no non-english characters, it is safe to remove them.<br>
<br>
Using an application such as Notepad++, you can choose to convert
encoding, and add/remove the BOM.<br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
Kimball, David (DCR) skrev:
<blockquote
 cite="mid:2F05B5BD24C96942AAB4787FB6114FF202C965E9@ES-MSG-007.es.govt.state.ma.us"
 type="cite">
  <pre wrap="">Turns out there were some hidden characters "&iuml;&raquo;&iquest;" at the beginning of the SLD XML file.  I don't know how they got there, and you can't see them in notepad, wordpad, XML Copy Editor, etc...thanks to Aleda for finding them!  So I started with an SLD file that DID work, deleted everything but the header section, and copied in the rest of the text from my SLD file after the header, and it works now.  Strangely, the part of GeoServer that does GetMap didn't seem to mind the extra characters (the SLD worked fine as far as symbolizing the map) but the GetLegendGraphic part choked on it.  Very strange, hopefully no one else will ever come across this weird problem.

--David


||||||| David Kimball
||||||| GIS Specialist
||||||| MA Department of Conservation and Recreation
||||||| <a class="moz-txt-link-freetext" href="http://www.mass.gov/dcr/stewardship/gis/">http://www.mass.gov/dcr/stewardship/gis/</a>
||||||| <a class="moz-txt-link-abbreviated" href="mailto:david.kimball@state.ma.us">david.kimball@state.ma.us</a>
||||||| 617.626.1447 phone
||||||| 617.626.1349 fax

-----Original Message-----
From: Christopher Schmidt [<a class="moz-txt-link-freetext" href="mailto:crschmidt@metacarta.com">mailto:crschmidt@metacarta.com</a>] 
Sent: Monday, February 02, 2009 10:49 AM
To: Kimball, David (DCR)
Cc: <a class="moz-txt-link-abbreviated" href="mailto:users@openlayers.org">users@openlayers.org</a>
Subject: Re: [OpenLayers-Users] Can't get GetLegendGraphic to work with &amp;SLD=

On Mon, Feb 02, 2009 at 10:34:57AM -0500, Kimball, David (DCR) wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Hi,

Can anyone help me troubleshoot why this doesn't return a legend
graphic?

<a class="moz-txt-link-freetext" href="http://giswebservices.massgis.state.ma.us/geoserver/wms?VERSION=1.1.0&RE">http://giswebservices.massgis.state.ma.us/geoserver/wms?VERSION=1.1.0&amp;RE</a>
QUEST=GetLegendGraphic&amp;LAYER=massgis:DCR.ROADS_TRAILS_POINT&amp;SLD=<a class="moz-txt-link-freetext" href="http://m">http://m</a>
aps.massgis.state.ma.us/dcr/trails/sld/DCR.ROADS_TRAILS_POINT--Type_Max_
18000.sld.xml&amp;WIDTH=16&amp;HEIGHT=16&amp;FORMAT=image/png
    </pre>
  </blockquote>
  <pre wrap=""><!---->
In general, the OpenLayers list will be better at helping you understand
why OpenLayers behaves in a certain way. Once you've narrowed it down to
a specific URL failing -- as you've done here, thank you for that --
you'll probably be able to get more from a GeoServer list than from the
OpenLayers list.

  </pre>
  <blockquote type="cite">
    <pre wrap="">It returns a file called "wms" that contains this error message:

&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;&lt;!DOCTYPE
ServiceExceptionReport SYSTEM
<a class="moz-txt-link-rfc2396E" href="http://schemas.opengis.net/wms/1.1.1/WMS_exception_1_1_1.dtd">"http://schemas.opengis.net/wms/1.1.1/WMS_exception_1_1_1.dtd"</a>&gt;
&lt;ServiceExceptionReport version="1.1.1" &gt;   &lt;ServiceException&gt;
      org.xml.sax.SAXParseException: Content is not allowed in prolog.
org.xml.sax.SAXParseException: Content is not allowed in prolog.
Content is not allowed in prolog.
&lt;/ServiceException&gt;&lt;/ServiceExceptionReport&gt;
    </pre>
  </blockquote>
  <pre wrap=""><!---->
1. Check to make sure that GeoServer is actually reaching
maps.massgis.state.ma.us . It is possible that there is a proxy or
something getting in the way, preventing GeoServer from etching your
SLD.

2. Perhaps put a prolog on the SLD file? &lt;?xml version='1.0' ?&gt;

Other than that, it sounds like a bug. I'd try the GeoServer list and
see if anyone there has any advice, personally... 

-- Chris

  </pre>
  <blockquote type="cite">
    <pre wrap="">The layer massgis:DCR.ROADS_TRAILS_POINT and the SLD file
<a class="moz-txt-link-freetext" href="http://maps.massgis.state.ma.us/dcr/trails/sld/DCR.ROADS_TRAILS_POINT--T">http://maps.massgis.state.ma.us/dcr/trails/sld/DCR.ROADS_TRAILS_POINT--T</a>
ype_Max_18000.sld.xml work fine in a GetMap request [see
<a class="moz-txt-link-freetext" href="http://maps.massgis.state.ma.us/dcr/trails/DCR_RoadTrail12.html">http://maps.massgis.state.ma.us/dcr/trails/DCR_RoadTrail12.html</a> - you
need to zoom in to see the point layer].  Any idea why I'm not getting a
legend image?  The URL looks like the URLs I've seen on the web and in
other people's emails to this group as far as I can tell.  If I remove
the &amp;SLD=... portion of the URL it works (returns a simple default black
dot legend).  And I've had no problem getting legends with &amp;STYLE=...
where the SLD file resides inside GeoServer as opposed to being a file
on the web.   (note: the server is GeoServer).

Thanks a lot,

David




||||||| David Kimball
||||||| GIS Specialist
||||||| MA Department of Conservation and Recreation
||||||| <a class="moz-txt-link-freetext" href="http://www.mass.gov/dcr/stewardship/gis/">http://www.mass.gov/dcr/stewardship/gis/</a>
||||||| <a class="moz-txt-link-abbreviated" href="mailto:david.kimball@state.ma.us">david.kimball@state.ma.us</a>
||||||| 617.626.1447 phone
||||||| 617.626.1349 fax
_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
<a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
</body>
</html>