For completeness (and to cover the simplest solution that I didn't present
earlier)....

adding svg:image elements with the xlink:hrefs pointing to the external
files would also work.

On Wed, Jun 22, 2011 at 9:45 PM, jonathan wood
<jonathanshaww...@gmail.com>wrote:

> Thanks for the additional info Helder.
>
> Note that even with a use tag, if you want to add the existing svg to a top
> level template programatically, you'd still need to follow the prior
> instructions with the following modification.  Note that this is not the use
> case specified by the requester as there is no element reuse in the
> originally described scenario.
>
> - uniquely id the new element
> - create a defs element and append the imported node to the defs element.
> - create and add a use element with the xlink:href attribute set to
> "url(#newnodeid)"
>
>
> 2011/6/22 Helder Magalhães <helder.magalh...@gmail.com>
>
>> Hi everyone,
>>
>> > One way to do it...assumes the file was read and placed into a byte
>> array by
>> > loadMyFile() (your implementation).
>> > All fluff and exception handling removed, but the basic sequence is:
>> [...]
>>
>> Apart from this (good) suggestion, note that SVG also has an "import"
>> mechanism, namely the 'use' element [1]. Just in case someone missed
>> it! ;-)
>>
>> Cheers,
>>  Helder
>>
>>
>> [1] http://www.w3.org/TR/SVG11/struct.html#UseElement
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscr...@xmlgraphics.apache.org
>> For additional commands, e-mail: batik-users-h...@xmlgraphics.apache.org
>>
>>
>

Reply via email to