xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephane Hillion" <shill...@ilog.fr>
Subject RE: SVGDocument
Date Fri, 01 Mar 2002 14:32:24 GMT
> From: Ahmad Morad [mailto:morad@db.informatik.uni-kassel.de]
> Sent: vendredi 1 mars 2002 11:21
> To: batik-dev@xml.apache.org
> 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: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Mime
View raw message