From: Trung D. <mas...@ya...> - 2006-10-23 23:29:09
|
Opps, Sorry Cory,=0A=0AThat's my bad. The String sld should be like this (t= his is a little bit different than the other case, but we can still see the= malformed xml code, like "<ogc:FeatureId =3D"parcelall.1917"/>", which is = one of the place that can cause the exception:=0A--------------------------= -------------------------------------------=0ADefault StylerDefault Stylerp= arcelallnameAbstracttitle1.7976931348623157E308#9191FF0.05#6666FFbuttmiter1= .01.00.0parcelallnameAbstracttitle1.7976931348623157E308#FF33990.5parcelall= nameAbstracttitle1.7976931348623157E308#FF00CC0.5=0A-----------------------= ------------------------------------=0A=0AThank you,=0A=0ATrung=0A=0A----- = Original Message ----=0AFrom: Cory Horner <ch...@re...>=0ATo: g= eot...@li...=0ACc: Trung Dinh <masktuxedo77@yaho= o.com>=0ASent: Monday, October 23, 2006 5:07:39 PM=0ASubject: Re: [Geotools= -gt2-users] SLDTransformer bug(?)=0A=0ATrung Dinh wrote:=0A=0A> We are usin= g Geotools 2.1M2. We used SDLTransfromer to transform some =0A> styles into= XML. Then when loading it back later to our tool, we got =0A> this Excepti= on:=0A>=0A> org.xml.sax.SAXParseException: Element type "ogc:FeatureId" mus= t be =0A> followed by either attribute specifications, ">" or "/>".=0A>=0A>= We think the problem is that SLDTransformer.transfrom() has some bug =0A> = in it. Anybody know if in a newer version this bug was fixed already? =0A>= Or if not, anybody know any workaround or anything?=0A>=0A> Thank you,=0A>= =0A> This is our analysis of the code:=0A>=0A> ----------------------------= ----------------------------=0A> + The code to transform it into XML was so= mething like this:=0A>=0A> String sld =3D new SLDTransformer().transform(ne= w Style[] { =0A> layer.getStyle() });=0A>=0A> + and we loaded it back like = this:=0A>=0A> InputStream is =3D new ByteArrayInputStream(sld.getBytes());= =0A> Style[] styles =3D new SLDParser(StyleFactory.createStyleFactory(), = =0A> is).readXML(); // <--Exception was thrown here=0A>=0A> + layer.getStyl= e().featureTypeStyList[1].ruleList[o].filter =3D [ =0A> parcelall.1955, par= celall.1919, parcelall.1958, parcelall.1917, =0A> parcelall.1956 ]=0A>=0A> = + The string "sld" had this value:=0A> -------------------------=0A> "Defau= lt StylerDefault =0A> StylerparcelallnameAbstracttitle1.7976931348623157E30= 8#9191FF0.05#6666FFbuttmiter1.01.00.0parcelallnameAbstracttitle1.7976931348= 623157E308#FF33330.5"=0A> ----------------------------=0A=0AIt is possible = that SLDTransformer supports more than SLDParser does. =0AWhat does your g= enerated sld look like? (it should be xml, what you have =0Ashown looks mor= e like the output of StyledLayerDescriptor.toString()...)=0A=0AI made some = changes on the 2.2.x branch which addressed some =0Ainconsistencies between= these two classes, but others may be =0Aoutstanding. Perhaps you could t= ry again using the 2.2.1 release, and =0Aif that fails we can file a bug re= port with your generated SLD file =0Aattached.=0A=0ACheers,=0ACory.=0A=0A= =0A=0A=0A=0A=0A |