Sorry folks again,
I tried to paste XML code into the message, but looks like Yahoo mail made it something else. Hence I attached the XML code (for the sld string) as a text file.
Thanks,
Trung
I tried to paste XML code into the message, but looks like Yahoo mail made it something else. Hence I attached the XML code (for the sld string) as a text file.
Thanks,
Trung
----- Original Message ----
From: Cory Horner <[EMAIL PROTECTED]>
To: [email protected]
Cc: Trung Dinh <[EMAIL PROTECTED]>
Sent: Monday, October 23, 2006 5:07:39 PM
Subject: Re: [Geotools-gt2-users] SLDTransformer bug(?)
From: Cory Horner <[EMAIL PROTECTED]>
To: [email protected]
Cc: Trung Dinh <[EMAIL PROTECTED]>
Sent: Monday, October 23, 2006 5:07:39 PM
Subject: Re: [Geotools-gt2-users] SLDTransformer bug(?)
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.
> 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.
<?xml version="1.0" encoding="UTF-8"?><sld:StyledLayerDescriptor xmlns:sld="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml"><sld:NamedLayer><sld:UserStyle><sld:Name>Default Styler</sld:Name><sld:Title>Default Styler</sld:Title><sld:Abstract></sld:Abstract><sld:FeatureTypeStyle><sld:FeatureTypeName>parcelall</sld:FeatureTypeName><sld:Rule><sld:Name>name</sld:Name><sld:Abstract>Abstract</sld:Abstract><sld:Title>title</sld:Title><sld:MaxScaleDenominator>1.7976931348623157E308</sld:MaxScaleDenominator><sld:PolygonSymbolizer><sld:Fill><sld:CssParameter name="fill"><ogc:Literal>#9191FF</ogc:Literal></sld:CssParameter><sld:CssParameter name="fill-opacity"><ogc:Literal>0.05</ogc:Literal></sld:CssParameter></sld:Fill><sld:Stroke><sld:CssParameter name="stroke"><ogc:Literal>#6666FF</ogc:Literal></sld:CssParameter><sld:CssParameter name="stroke-linecap"><ogc:Literal>butt</ogc:Literal></sld:CssParameter><sld:CssParameter name="stroke-linejoin"><ogc:Literal>miter</ogc:Literal></sld:CssParameter><sld:CssParameter name="stroke-opacity"><ogc:Literal>1.0</ogc:Literal></sld:CssParameter><sld:CssParameter name="stroke-width"><ogc:Literal>1.0</ogc:Literal></sld:CssParameter><sld:CssParameter name="stroke-dashoffset"><ogc:Literal>0.0</ogc:Literal></sld:CssParameter></sld:Stroke></sld:PolygonSymbolizer></sld:Rule></sld:FeatureTypeStyle><sld:FeatureTypeStyle><sld:FeatureTypeName>parcelall</sld:FeatureTypeName><sld:Rule><sld:Name>name</sld:Name><sld:Abstract>Abstract</sld:Abstract><sld:Title>title</sld:Title><sld:MaxScaleDenominator>1.7976931348623157E308</sld:MaxScaleDenominator><ogc:Filter><ogc:FeatureId ="parcelall.1919"/><ogc:FeatureId ="parcelall.1958"/><ogc:FeatureId ="parcelall.1956"/></ogc:Filter><sld:PolygonSymbolizer><sld:Fill><sld:CssParameter name="fill"><ogc:Literal>#FF3399</ogc:Literal></sld:CssParameter><sld:CssParameter name="fill-opacity"><ogc:Literal>0.5</ogc:Literal></sld:CssParameter></sld:Fill></sld:PolygonSymbolizer></sld:Rule></sld:FeatureTypeStyle><sld:FeatureTypeStyle><sld:FeatureTypeName>parcelall</sld:FeatureTypeName><sld:Rule><sld:Name>name</sld:Name><sld:Abstract>Abstract</sld:Abstract><sld:Title>title</sld:Title><sld:MaxScaleDenominator>1.7976931348623157E308</sld:MaxScaleDenominator><ogc:Filter><ogc:FeatureId ="parcelall.1955"/><ogc:FeatureId ="parcelall.1919"/><ogc:FeatureId ="parcelall.1958"/><ogc:FeatureId ="parcelall.1917"/><ogc:FeatureId ="parcelall.1956"/></ogc:Filter><sld:PolygonSymbolizer><sld:Fill><sld:CssParameter name="fill"><ogc:Literal>#FF00CC</ogc:Literal></sld:CssParameter><sld:CssParameter name="fill-opacity"><ogc:Literal>0.5</ogc:Literal></sld:CssParameter></sld:Fill></sld:PolygonSymbolizer></sld:Rule></sld:FeatureTypeStyle></sld:UserStyle></sld:NamedLayer></sld:StyledLayerDescriptor>
------------------------------------------------------------------------- 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
