Re: embedding nodes from an external file

According to the spec, the 'image' element in SVG can point to an entire
external SVG file, and that external file will be rendered into the
rectangular area specified by the x/y/width/height attributes. For example:

<svg ...>
    <image xlink:href="chairs.svg" x="100" y="100" width="300" height="200"/>
</svg>

The spec says that the 'use' element in SVG can point to a single element
within an external SVG file:

<svg>
   <use xlink:href="chairs.svg#Chair01"  x="100" y="100" width="300"
height="200"/>
</svg>

(Things are a bit complex with 'use', depending on whether you reference a
'g', a 'symbol' or an 'svg' element. The spec provides details.)

I believe that most implementations haven't gotten around to implementing
either of the above features. The CSIRO viewer might implement the 'image'
element pointing to an external SVG file, but I'm pretty sure it doesn't
support the second case above (i.e., the 'use' case). The Adobe SVG Viewer
doesn't support anything having to do with external SVG files at this time;
all referenced SVG content must be within the same file.

One thing that MIGHT work in some implementations is to use an XML entity
reference to actually include the referenced SVG file (in effect) inline as
included content. Sorry, I haven't tried this out. Maybe someone else on
www-svg can pipe in about whether this approach might work.

Jon Ferraiolo
SVG Editor
Adobe Systems Incorporated

At 10:42 AM 6/22/00 +0530, dmanjuna@in.ibm.com wrote:
>Hi guys ..,
>
>I would like to know how to see/embed/use svg nodes defined in one file in
>another file.
>
>i.e how do I embed elements from another SVG file ?
>
>For example...
>
>I have files called floor1.svg and chairs.svg.
>
>floor1.svg contains a floor plan having walls etc.
>
>chairs.svg has the symbol definitions of various chair(s).
>
>how do I embed a 'chair'  into the 'floor1' ?
>
>Thanks Guys.
>
>Love,
>.... Manjunath.
> 

Received on Thursday, 22 June 2000 12:02:15 UTC