Hi Phil,

"Phil Wright" <[EMAIL PROTECTED]> wrote on 11/29/2006 07:57:57 PM:

> Say I have a file something like this:
> <somefile>
>    <svg width="6.5in" height="9in" contentStyleType="text/css"
>     [...]
 
> And I have read it in via an XML parser and have grabbed one of the SVG 
elements.
> 
> How do I turn that grabbed element into a SVGDocument such that I can 
then 
> give to a  canvas.setDocument() call?

   With all but the SVN version of Batik you need to use 'importNode'
to create nodes in a new document:

        batik.dom.svg.SVGDOMImplementation domImpl = new 
SVGDOMImplementation;
        SVGDocument doc = domImpl.createDocument(SVG_NS, "svg", null);
        doc.appendChild(doc.importNode(otherSVGElement, true));

> My first though was to create an empty SVGDocument and then use 
document.
> adoptNode(thatelement)  based on something recently posted here but that 
gave 
> me a not particularly helpful error: 

   Adopt node is part of DOM Level 3, SVG 1.0/1.1 only used DOM Level 2.
The SVG version of Batik is adding support for DOM Level 3 methods.


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

Reply via email to