Details
Description
While mostly adhering to the structure and semantics of the SLD specification, the API is lacking some key pieces and some naming conventions are broken. Additional, the current XMLEncoder does not produce formatted XML and misses out on encoding certain elements.
Missing Pieces:
1) Lack of representation for StyledLayerDescriptor
The root of an SLD document, this element contains the child elements
sld:NamedLayer and sld:UserLayer in addition to the version
attribute.
2) Lack of representation for NamedLayer which contains the elements
sld:Name, sld:LayerFeatureConstraints, and the choice of
sld:NamedStyle or sld:UserStyle.
Problems:
1) The misnamed SLDStyle object, which is resposible for decoding a
SLD, misses out on the NamedStyle, a key piece of WMS.
2) Creation of an SLD document through the existing XMLEncoder is
limited as a result of these missing elements.
Broken conventions (that I found):
PointSymbolizer geometryPropertyName and setGeometryPropertyName
Problem:
1) By not sticking to JavaBeans naming conventions, the automatic
creation of editors is hindered, the proper use is get/set.
The recommended way to solve this is to use a TransformerHandler to which you send sax events, for example:
TransformerHandler th;
th.startElement(SLD_NAMESPACE, "UserStyle", null, attributes);
// do the rest
th.startElement(SLD_NAMESPACE, "UserStyle", null);
This has the advantage that XML special characters are automatically converted and the outptu is formatted for you.