I'm trying to accomplish an apparently simple task, to display some lines from a postgis table, but I don't know how to do it. The table has, say, 3 fields, one for the geometry and the other two have some value. I'd like to set the color of the line based on one of the fields, I'll call it field1, and to set the dash pattern of the line based on the second field (field2).
field1
value color
1 black
2 red
3 green
...
field2
value dash pattern
1 solid (e.g. values for stroke-dasharray)
2 dot line
...
I know how to create a style to accomplish that but mixing the filters/rules for managing 2 fields is a mess. Using another language I'd use a function with 2 parameters (the values of field1 and field2) returning the values to use for stroke and stroke-dasharray. I searched the docs and the only thing I found out is the function Recode but, as I understand, it uses only one input parameter. I read the docs about Transformations but I assume that they must be created outside SLD, I think it'd be overkill for my needs. Is there a way to accomplish my task?