I thank you for your response Anders, but unfortunately I am still getting
the same error after I follow your suggestions.  My error seems to be
something with the SLD not knowing which layer it is intended for as the
error I get says "SLD document does not contain layers".  This is important
for my project to go further, please if anyone has any other ideas do share
them with me :)

Thanks!

elshae

2011/1/17 Anders Söderman <anders.soder...@gisassistans.se>

>  Sorry – I forgot a copy for you. Anders S
>
>
>  ------------------------------
>
> *From:* Anders Söderman [mailto:anders.soder...@gisassistans.se]
> *Sent:* den 18 januari 2011 05:56
> *To:* 'geoserver-users@lists.sourceforge.net'
> *Subject:* Re: [Geoserver-users] Change WMS SLD Through OpenLayers
>
>
>
> Hello.
>
> Andrea Aime´s answer below helped me ”clean up” some of my SLDs with
> TextSymbolizer.
>
> In your case at least Fill comes before Halo.
>
> Good luck. Anders S
>
>
>
>
> http://old.nabble.com/SLD-error-not-validating-%22org.xml.sax.SAXParseException%3A-cvc-complex-type.2.4.a%22-td29086522.html
>
> …
>
> The TextSymbolizer definition provides the correct order:
>
>   <xsd:element name="TextSymbolizer" substitutionGroup="sld:Symbolizer">
>      <xsd:annotation>
>        <xsd:documentation>
>          A "TextSymbolizer" is used to render text labels according to
>          various graphical parameters.
>        </xsd:documentation>
>      </xsd:annotation>
>      <xsd:complexType>
>        <xsd:complexContent>
>          <xsd:extension base="sld:SymbolizerType">
>            <xsd:sequence>
>              <xsd:element ref="sld:Geometry" minOccurs="0"/>
>              <xsd:element ref="sld:Label" minOccurs="0"/>
>              <xsd:element ref="sld:Font" minOccurs="0"/>
>              <xsd:element ref="sld:LabelPlacement" minOccurs="0"/>
>              <xsd:element ref="sld:*Halo*" minOccurs="0"/>
>              <xsd:element ref="sld:*Fill*" minOccurs="0"/>
>
> …
>
> ------------------------------
>
>
>
> Message: 2
>
> Date: Mon, 17 Jan 2011 11:55:54 -0500
>
> From: IT Intern <itinter...@gmail.com>
>
> Subject: [Geoserver-users] Change WMS SLD Through OpenLayers
>
> To: geoserver-users@lists.sourceforge.net
>
> Message-ID:
>
>            <AANLkTi=Yt_QSmjYW2HCfCMO__hY8V6oW=ou_chw0f...@mail.gmail.com>
>
> Content-Type: text/plain; charset="iso-8859-1"
>
>
>
> Hello GeoServer List,
>
>
>
> I am pretty excited because I just bumped into a few posts that said that
> it is possible to change SLD through OpenLayers.  I never knew this was
> possible and I have been creating an overhead of layers and sql views in my
> server just to promote different features :p.  Well now I am trying to do
> such a thing and it is not working for me, but I think I am close...
>
>
>
> //My Layer (WMSLayer I wrote myself)
>
> var tibet_1900_no_name = WMSLayer("Tibet 1900 - Kham Towns and Mountains",
> 'cite:tibet_1900_no_names', false, 0, 'Kham');
>
>
>
> function WMSLayer(text, layers, visible, minScale, layerId){
>
>     var layer = new OpenLayers.Layer.WMS(text, "
>
> http://localhost:8080/geoserver/wms";,
>
>                 {layers: layers, transparent: true},
>
>                 {layerId: layerId, isBaseLayer: false,
>
> displayInLayerSwitcher: true, visibility: visible, minScale: minScale}
>
>      );
>
>                    return layer;
>
> }//end WMSLayer
>
>
>
> The layer works as expected..but then I do this when an option in a menu is
> clicked, tibet_1900_no_name.mergeNewParams({SLD :'
>
> http://localhost:8080/geoserver/wms/tibet_1900.xml'});
>
>
>
> and I get the following message "SLD document contains no layers" on a
> blank white layer.
>
>
>
> This is my SLD:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <StyledLayerDescriptor version="1.0.0" xmlns="http://www.opengis.net/sld";
>
> xmlns:ogc="http://www.opengis.net/ogc";
>
>   xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:xsi="
>
> http://www.w3.org/2001/XMLSchema-instance";
>
>   xsi:schemaLocation="http://www.opengis.net/sld
>
> http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd";>
>
>   <NamedLayer>
>
>     <Name>cite:tibet_1900_no_names</Name>
>
>     <UserStyle>
>
>       <Title>Default point</Title>
>
>
>
>
>
>       <FeatureTypeStyle>
>
>         <!--<FeatureTypeName>Feature</FeatureTypeName>-->
>
>         <Rule>
>
>           <PointSymbolizer>
>
>             <Graphic>
>
>
>
>             <Mark>
>
>                 <WellKnownName>Square</WellKnownName>
>
>                 <Fill>
>
>                   <CssParameter name="fill">#73EAF7</CssParameter>
>
>                 </Fill>
>
>                 <Stroke>
>
>                        <CssParameter name="stroke">#39B331</CssParameter>
>
>                        <CssParameter name="stroke-width">2</CssParameter>
>
>                 </Stroke>
>
>               </Mark>
>
>
>
>              <Size>6</Size>
>
>
>
>             </Graphic>
>
>           </PointSymbolizer>
>
>
>
>           <TextSymbolizer>
>
>           <label><ogc:PropertyName>name_rom</ogc:PropertyName>
>
>           </label>
>
>
>
>
>
>     <Font>
>
>        <!-- <CssParameter name="font-family">SimSun</CssParameter>-->
>
>         <CssParameter name="font-family">Unifont Medium</CssParameter>
>
>         <CssParameter name="font-style">Normal</CssParameter>
>
>         <CssParameter name="font-size">11</CssParameter>
>
>        <!-- <CssParameter name="font-weight">bold</CssParameter>-->
>
>     </Font>
>
>
>
>     <Fill>
>
>         <CssParameter name="fill">#000000</CssParameter>
>
>     </Fill>
>
>
>
>      <!--  make the label easy to read-->
>
>             <Halo>
>
>               <Radius>
>
>              <ogc:Literal>2</ogc:Literal>
>
>               </Radius>
>
>               <Fill>
>
>             <CssParameter name="fill">#FFFFFF</CssParameter>
>
>             <CssParameter name="fill-opacity">0.85</CssParameter>
>
>
>
>               </Fill>
>
>             </Halo>
>
>
>
> </TextSymbolizer>
>
>
>
>         </Rule>
>
>
>
>       </FeatureTypeStyle>
>
>     </UserStyle>
>
>   </NamedLayer>
>
> </StyledLayerDescriptor>
>
>
>
> If anyone can tell me what I am doing wrong I'd really appreciate it :)
>
>
>
> Thanks,
>
> elshae
>
------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to