Jon Bråtøymyr wrote:
> 
> Hi,
> 
> I'm having problems with creating an image from a plain
> org.w3c.dom.Document. I was told that I could use
> DOMUtilities.deepCloneDocument to convert a w3c-Document to a SVGDocument,
> but when I run the transcoding I get a ClassCastException. Apparently when
> the ImageTranscoder tries to cast the root element to
> org.apache.batik.dom.GenericElement.
> 
> I'm using a very simple XML in this example to illustrate my problem,
> normally I would run a XSL transformation on a Document containing financial
> information to create a JPEG image in a report (that is created with an
> other transformation on the same source).
> 
> Now I must convert the resulting Document into a String before I give it to
> Batik, not a very effective process I would believe...
> 
> Below is some sample code that illustrates my problem, as well as the
> exception I get. Can anyone see if I'm doing anything wrong?

AFAIK not -- at least I ended up with the same approach for my website
generation program. Batik often claims to take generic DOM but assumes
to get its own implementation.

You can find the thread I started on this topic here:
  
http://www-sop.inria.fr/koala/batik/mlists/batik-users/archives/msg00213.html

Since I don't create the SVGs dynamically it is not a big issue for me,
but by now I create more than 100 buttons/banners for one site and then
it takes really long -- longer than the actual XSLT processing :-( Most
of them are even really simple SVGs that just paint a rectangle, a small
path and some text. I didn't try any benchmarking yet, but the
additional file is surely quite expensive, esp. in Java.

Unfortunately I won't have time to address this issue myself -- at least
not in the next weeks.

Regards,
   PeterB

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to