Trung Dinh wrote:

> We are using Geotools 2.1M2. We used SDLTransfromer to transform some 
> styles into XML. Then when loading it back later to our tool, we got 
> this Exception:
>
> org.xml.sax.SAXParseException: Element type "ogc:FeatureId" must be 
> followed by either attribute specifications, ">" or "/>".
>
> We think the problem is that SLDTransformer.transfrom() has some bug 
> in  it. Anybody know if in a newer version this bug was fixed already? 
> Or if not, anybody know any workaround or anything?
>
> Thank you,
>
> This is our analysis of the code:
>
> --------------------------------------------------------
> + The code to transform it into XML was something like this:
>
> String sld = new SLDTransformer().transform(new Style[] { 
> layer.getStyle() });
>
> + and we loaded it back like this:
>
> InputStream is = new ByteArrayInputStream(sld.getBytes());
> Style[] styles = new SLDParser(StyleFactory.createStyleFactory(), 
> is).readXML(); // <--Exception was thrown here
>
> + layer.getStyle().featureTypeStyList[1].ruleList[o].filter = [ 
> parcelall.1955, parcelall.1919, parcelall.1958, parcelall.1917, 
> parcelall.1956 ]
>
> + The string "sld" had this value:
> -------------------------
> "Default StylerDefault 
> StylerparcelallnameAbstracttitle1.7976931348623157E308#9191FF0.05#6666FFbuttmiter1.01.00.0parcelallnameAbstracttitle1.7976931348623157E308#FF33330.5"
> ----------------------------

It is possible that SLDTransformer supports more than SLDParser does.  
What does your generated sld look like? (it should be xml, what you have 
shown looks more like the output of StyledLayerDescriptor.toString()...)

I made some changes on the 2.2.x branch which addressed some 
inconsistencies between these two classes, but others may be 
outstanding.   Perhaps you could try again using the 2.2.1 release, and 
if that fails we can file a bug report with your generated SLD file 
attached.

Cheers,
Cory.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to