On Tuesday 26 June 2001 14:34, Peter Becker wrote:
> 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 think you might have used the method with an appropriate argument.
You must give the original document and then the DOMImplementation you want
to use.
The document is the one you have (that can be from xerces, generic DOM or
whatever) then the DOMImplementation must be the SVGDOMImplementation.
DOMImplementation impl = SVGDOMImplementation.getDOMImplementation();
BTW: We could not rely on a generic DOM implementation at least for building
and rendering SVG documents because SVG is complex and needs special hooks.
The best example is to implement external <use> element with the correct
cascading algorithm for the CSS properties.
Hope this helps,
Thierry.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]