When reading in an SLD, Mapserver reverses the sequence of the rules/classes.
This does not make sense, since the Legend will also show the reverse of what
you would expect.
Here is a patch:
--- mapogcsld.c 2006-09-04 08:43:21.000000000 +0200
+++ mapogcsld.c 2006-09-04 08:57:57.000000000 +0200
@@ -404,7 +404,8 @@
map->layers[i].type = pasLayers[j].type;
map->layers[i].numclasses = 0;
iClass = 0;
- for (k=pasLayers[j].numclasses-1; k>=0; k--)
+ //for (k=pasLayers[j].numclasses-1; k>=0; k--)
+ for (k=0; k < pasLayers[j].numclasses; k++)
{
initClass(&map->layers[i].class[iClass]);
msCopyClass(&map->layers[i].class[iClass],