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.
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
2) Lack of representation for NamedLayer which contains the elements
sld:Name, sld:LayerFeatureConstraints, and the choice of
sld:NamedStyle or sld:UserStyle.
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
1) By not sticking to JavaBeans naming conventions, the automatic
creation of editors is hindered, the proper use is get/set.
CodeHaus Comment From: seangeo - Time: Fri, 17 Oct 2003 21:04:22 -0500
I'd like to add that the current method of encoding XML using streaming output is fragile. For example, if I have an SLD object with the &, < or > characters in any of its properties, the output is not going to be valid XML. The Filter XMLEncoder also suffers from the same problem.
The recommended way to solve this is to use a TransformerHandler to which you send sax events, for example:
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.
CodeHaus Comment From: ianturton - Time: Mon, 20 Oct 2003 04:56:17 -0500
I'll take a look at this but it won't be until next month, so if others
want to start with out me feel free.
CodeHaus Comment From: ianschneider - Time: Mon, 20 Oct 2003 11:05:37 -0500
In regards to Seans comment on the recommended way to handle SLDEncoding, this is precisely the method I've chosen to handle this.
CodeHaus Comment From: jgarnett - Time: Mon, 13 Mar 2006 01:59:41 -0600
We have performed a check against SLD 1.0 as part of geotools 2.2.x