Hi JJ,

JJ Rock <[EMAIL PROTECTED]> wrote on 11/18/2005 07:50:35 AM:

> Does anybody have a good idea on how to insert multiple SVG files and 
> basically "merge" them onto one JSVGCanvas?  Basically this is a drag 
and drop
> type operation, where you are taking various objects contained in 
separate SVG
> files and putting them together.

   You might want to look at the 'use' or 'image' elements.  I'm not sure
if it is important that the referenced content actually become part of the
host document or not.

> I was thinking about adding a group to the SVGDocument contained within 
the 
> canvas and then iteratively adding each element from the other file(s) 
into that group.
> 
> Will this work?

   This should work, you might want to look at 'Document.importNode' which 
would
let you import and entire subtree in one call, then you could append the 
imported
subtree with one 'addChild' call.

>   Is there a better way?

   If you can I would recommend using 'use' or 'image'.  Even if you need 
the
end document to be 'stand alone' I would lean towards cloning the 
referenced
content and adding it to a 'defs' element and referencing the local copy
from a 'use' element (especially if they may have multiple instances of
the content in the composite document).


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

Reply via email to