Including svg in another svg file

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Including svg in another svg file

derek-9
My apologies if this issue has previously been dealt with here
-- I'm quite new to SVG, let alone to this forum.

I'm trying something rather straightforward: including an SVG
file 'child.svg' in another one 'parent.svg'. Both files are
located in the same directory of my local file system.

I can't get it to work, though, neither with <use xlink:href ...>
nor with <image xlink:href ...>

You find the file content at the bottom of this message. Am I
missing something here or is there a genuine problem with
the configuration I'm using (Firefox 1.5.2beta on WinXP
/ Cairo Win32)?

Thanks in advance

Derek


parent.svg
==========

<?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
   "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="200" height="200"
      xmlns="http://www.w3.org/2000/svg"
      xmlns:xlink="http://www.w3.org/1999/xlink">

   <!--
     ** neither alternative appears to work
   -->

   <use xlink:href="./child.svg" x="0" y="0" width="200" height="200"/>
   <image xlink:href="./child.svg" x="0" y="0" width="200" height="200"/>

</svg>


child.svg
=========

<svg width="200" height="200">
   <rect x="0" y="0" width="200" height="200" fill="#FF0000"/>
</svg>
_______________________________________________
Mozilla-svg mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-svg
Reply | Threaded
Open this post in threaded view
|

Re: Including svg in another svg file

place
current status; http://www.mozilla.org/projects/svg/status.html

USE only internal links
IMAGE only raster, no SVG

you could possibly use XSLT to include other files inline, multiple SVG
elements does work.

_______________________________________________
Mozilla-svg mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-svg
Reply | Threaded
Open this post in threaded view
|

Re: Including svg in another svg file

place
In reply to this post by derek-9
check current status; http://www.mozilla.org/projects/svg/status.html

USE only internal links
IMAGE only raster, no SVG

XSL can include other files inline, and i know multiple SVG
elements do work.

I've used XSL to transform from raw XML data to SVG graphs of it, no
problem.

_______________________________________________
Mozilla-svg mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-svg
Reply | Threaded
Open this post in threaded view
|

Re: Including svg in another svg file

Jonathan Watt-2
In reply to this post by derek-9
Hi Derek,

derek wrote:
> My apologies if this issue has previously been dealt with here
> -- I'm quite new to SVG, let alone to this forum.
>
> I'm trying something rather straightforward: including an SVG
> file 'child.svg' in another one 'parent.svg'. Both files are
> located in the same directory of my local file system.

Moz don't support any means of doing this with markup yet. You could
possibly use XMLHttpRequest to fetch and parse the file, then insert it
into the parent's DOM.

-Jonathan
_______________________________________________
Mozilla-svg mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-svg