On Fri, Nov 12, 2010 at 1:27 PM, Flavio Carmo <flavio.o.ca...@gmail.com> wrote: > Hi, > i couldnt find any similar question, so i came here to ask if a label can > use two fields to get the data from, something like this: > <sld:TextSymbolizer> > <sld:Label> > <ogc:PropertyName>FIELD_1+FIELD_2</ogc:PropertyName> > </sld:Label> > </sld:TextSymbolizer> > Or use a custom string, like this: > <sld:TextSymbolizer> > <sld:Label> > <ogc:PropertyName>"Zone:"+ZONE_NUMBER</ogc:PropertyName> > </sld:Label> > </sld:TextSymbolizer> > This is possible?
Label is a mixed element, you can have both straight strings and tags mixed togheter. Something like: <sld:Label> Zone<![CDATA[ ]]><ogc:PropertyName>ZONE_NUMBER</ogc:PropertyName </sld:Label> or <sld:Label> <ogc:PropertyName>FIELD1</ogc:PropertyName<![CDATA[ ]]><ogc:PropertyName>FIELD2</ogc:PropertyName </sld:Label> should do the trick. As far as I remember spaces have to be kept in CDATA sections to avoid the xml parsing rules for that element to wipe them away (can't remember if all subsequent spaces are turned into one, or if not even that one is preserved, try without CDATA and add it back if necessary) Cheers Andrea ----------------------------------------------------- Ing. Andrea Aime Senior Software Engineer GeoSolutions S.A.S. Via Poggio alle Viti 1187 55054 Massarosa (LU) Italy phone: +39 0584962313 fax: +39 0584962313 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.linkedin.com/in/andreaaime http://twitter.com/geowolf ----------------------------------------------------- ------------------------------------------------------------------------------ Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more! http://p.sf.net/sfu/dell-eql-dev2dev _______________________________________________ Geoserver-users mailing list Geoserver-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geoserver-users