Damn, you are fast David :)

Thanks, that works great.

Yes this is rather cumbersome.  I like the idea of implicit concatenation, and 
that as one of the first things I tried but on the first element was being 
used.  And I agree on the whitespace unless you can come up with an operator 
that says "anything inside of this is a literal but I honor attributes in [].  
Kind of like the difference between "" and '' in perl say.

{{The road name is [st_name] and it is category [cat]}}

as opposed to 

"The road name is " [st_name] " and it is category " [cat]

Either would be a vast improvement though.

charles

On May 26, 2011, at 12:30 PM, David Winslow wrote:

> Yeah, this is one place where SLD is actually less verbose (because it 
> magically wraps sequences of expressions in a function call that concatenates 
> them as strings.) 
> 
> This syntax should work (untested though):
> 
> label: [strConcat(strConcat(strConcat(strConcat("[", attr1), "] (["), attr2), 
> "])")];
> 
> Pretty gross, right? If I think about it a bit I could probably make it 
> possible to avoid the strConcats; the rule would be that if a list of 
> properties is found for a label, it is implicitly concatenated.  I don't want 
> to make whitespace significant outside of string literals though, so it would 
> come out something like this:
> 
> label: "[" [attr1] "] ([" [attr2] "])";
> 
> (remember if there are commas that means multiple labels.)
> 
> What do you think?
> 
> --
> David Winslow
> OpenGeo - http://opengeo.org/
> 
> On Thu, May 26, 2011 at 12:20 PM, Charles Galpin <[email protected]> wrote:
> I can't seem to figure out how to use multiple attributes in a label. The 
> tutorial says you can use a CQL expression but I am not sure how to 
> concatenate strings. I'd like to do something like, although this just makes 
> it a literal.
> 
> label:  "[attr1]  ([attr2])";
> 
> thanks,
> charles
> 
> 
> ------------------------------------------------------------------------------
> vRanger cuts backup time in half-while increasing security.
> With the market-leading solution for virtual backup and recovery,
> you get blazing-fast, flexible, and affordable data protection.
> Download your free trial now.
> http://p.sf.net/sfu/quest-d2dcopy1
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
> 

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to