> From: Ahmad Morad [mailto:[EMAIL PROTECTED]] > Sent: vendredi 1 mars 2002 11:21 > To: [EMAIL PROTECTED] > Subject: SVGDocument > > > Hi, > > In my Applikation I read the visualization from a socket. I read the > XML-Content from the Inputstream and produce a dom Document. If this is an > HTML I use the JEditorPane swing widget to render it. If this is SVG > I want to use the JSVGCanvas widget. This became as first argument a > SVGDocument object. > > > In the batik API, the SVGDocument is a (dom) Document! > So the type cast > > Document doc; > SVGDocument svgDoc = (SVGDocument) doc; > > must be correct! However I got type a cast Ecception. It sounds > to be a small a problem, but I don't really find a way how to > create a SVGDocument from a (dom) Document. Something like: > > private SVGDocument doc2svgDoc (Document doc) { > SVGDocument svgDoc;
svgDoc = (SVGDocument)org.apache.batik.dom.util.DOMUtilities.deepCloneDocument(doc, org.apache.batik.dom.svg.SVGDOMImplementation.getDOMImplementation()); > return svgDoc; > } > I have not try to compile, but it should work ;-) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]