Hi all,
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 Styler Default Styler parcelall name Abstract title 1.7976931348623157E308 #9191FF 0.05 #6666FF butt miter 1.0 1.0 0.0 parcelall name Abstract title 1.7976931348623157E308 #FF3333 0.5 "
----------------------------
+ This is the exception trace:
java.lang.RuntimeException: org.xml.sax.SAXParseException: Element type "ogc:FeatureId" must be followed by either attribute specifications, ">" or "/>".
java.lang.RuntimeException: org.xml.sax.SAXParseException: Element type "ogc:FeatureId" must be followed by either attribute specifications, ">" or "/>".
at org.geotools.styling.SLDParser.readXML(SLDParser.java:174)
at tyler.gis.document.GisDocument.unpackLayers(GisDocument.java:216)
at tyler.gis.client.document.GisDocumentViewer.setDocument(GisDocumentViewer.java:304)
at tyler.gis.client.document.GisDocumentBrowserView.handleFolderCapable(GisDocumentBrowserView.java:69)
at tyler.empire.client.folder.FolderCapableUtil.handleLocator(FolderCapableUtil.java:56)
at tyler.empire.client.folder.FolderView$7.mouseClicked(FolderView.java:130)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
at java.awt.Component.processMouseEvent(Component.java:5491)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: org.xml.sax.SAXParseException: Element type "ogc:FeatureId" must be followed by either attribute specifications, ">" or "/>".
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
at org.geotools.styling.SLDParser.readXML(SLDParser.java:170)
... 25 more
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:
-------------------------
"
----------------------------
+ This is the exception trace:
java.lang.RuntimeException: org.xml.sax.SAXParseException: Element type "ogc:FeatureId" must be followed by either attribute specifications, ">" or "/>".
java.lang.RuntimeException: org.xml.sax.SAXParseException: Element type "ogc:FeatureId" must be followed by either attribute specifications, ">" or "/>".
at org.geotools.styling.SLDParser.readXML(SLDParser.java:174)
at tyler.gis.document.GisDocument.unpackLayers(GisDocument.java:216)
at tyler.gis.client.document.GisDocumentViewer.setDocument(GisDocumentViewer.java:304)
at tyler.gis.client.document.GisDocumentBrowserView.handleFolderCapable(GisDocumentBrowserView.java:69)
at tyler.empire.client.folder.FolderCapableUtil.handleLocator(FolderCapableUtil.java:56)
at tyler.empire.client.folder.FolderView$7.mouseClicked(FolderView.java:130)
at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:212)
at java.awt.Component.processMouseEvent(Component.java:5491)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3901)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1778)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: org.xml.sax.SAXParseException: Element type "ogc:FeatureId" must be followed by either attribute specifications, ">" or "/>".
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:264)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:292)
at org.geotools.styling.SLDParser.readXML(SLDParser.java:170)
... 25 more
------------------------------------------------------------------------- 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
