id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
3631	Transformation from XML to MapFile only handles one PROCESSING element	Iregart	aboudreault	"Hello Mapserver team,

I encountered a bug, transforming a mapfile XML to the mapfile format.
It seems, that only one PROCESSING element is written into the resulting mapfile, even if there are more defined in the XML.

Here is what I did:[[BR]]
- I used only the contents of the folder ''xmlmapfile'', contained in the 5.6.5 source release.[[BR]]
- I used the mapfile.xsd to create a source binding (JAVA) in a Eclipse plug-in.[[BR]]
- The binding classes I used to create the contents of the mapfile XML in memory.[[BR]]
- Then I transformed the mapfile XML into the original mapfile format, using the mapfile.xsl.[[BR]]
- The written mapfile only contains one PROCESSING directive, even if I add two elements into the XML.[[BR]]

This is, how I fill the processing element of a layer:
{{{
    double min = 0.0;
    double max = grid.getMax();
    double buckets = Math.floor( max / 0.05 );

    List<String> processing = layer.getProcessing();
    processing.add( String.format( Locale.PRC, ""SCALE=%.2f %.2f"", min, max) );
    processing.add( String.format( Locale.PRC, ""SCALE_BUCKETS=%d"", (int) buckets ) );
}}}

This is the result of the transformation:
{{{
MAP

NAME ""Raster""
STATUS ON
EXTENT 3682646.0 5358058.0 4080506.0 5816758.0
IMAGECOLOR 255 255 255
PROJECTION
  ""init=EPSG:31467""
END
SIZE 58 67
UNITS meters
WEB
  METADATA
    ""wms_title"" ""Raster""
    ""wms_onlineresource"" ""http://localhost/cgi-bin/mapserv.exe?map=mapserver.map&""
    ""wms_srs"" ""EPSG:31467""
  END
END

LAYER
  NAME ""raster_1""
  TYPE RASTER
  STATUS ON
  CLASS
    EXPRESSION ([pixel] <= 0.50)
    STYLE
      COLOR 123 0 0
      
    END
    
  END
  CLASS
    EXPRESSION ([pixel] > 0.50)
    STYLE
      COLOR 255 0 0
      
    END
    
  END
  DATA ""raster_1.tif""
  
  METADATA
    ""wms_title"" ""Raster #1""
    ""wms_onlineresource"" ""http://localhost/cgi-bin/mapserv.exe?map=mapserver.map&""
    ""wms_srs"" ""EPSG:31467""
    ""wms_extent"" ""3682646.000000 5358058.000000 4080506.000000 5816758.000000""
  END
  PROCESSING ""SCALE=0.00 9.75""

  PROJECTION
    ""init=EPSG:31467""
  END
END
END
}}}

If you need more information, please ask.

Best regards,[[BR]]
Holger Albert"	defect	closed	normal		MapFile XML Schema	5.6	normal	fixed	XML, XSL, XSLT, MapFile, Transformation, Processing	
