W3C home > Mailing lists > Public > www-svg@w3.org > October 2001

External reference usage?

From: Philippe Converset <pconverset@Qarbon.com>
Date: Wed, 03 Oct 2001 13:28:28 +0200
Message-Id: <5.1.0.14.0.20011003131617.00a97e08@mail.qarbon.com>
To: www-svg@w3.org
Hi,

I'm trying to use an external reference from an svg document to another one 
but I'm not sure how to dot it.

Let's say I want to get something like:
<svg width="8cm" height="3cm">
   <defs>
     <linearGradient id="Gradient01">
       <stop offset="20%" stop-color="#39F" />
       <stop offset="90%" stop-color="#F3F" />
     </linearGradient>
   </defs>
   <rect x="1cm" y="1cm" width="6cm" height="1cm" fill="url(#Gradient01)"  />
</svg>

but with the defs part in another svg file.

I'd like to use two files, the defs file:
<svg>
   <defs>
     <linearGradient id="Gradient01">
       <stop offset="20%" stop-color="#39F" />
       <stop offset="90%" stop-color="#F3F" />
     </linearGradient>
   </defs>
</svg>

and the main file:
<svg width="8cm" height="3cm">
   <rect x="1cm" y="1cm" width="6cm" height="1cm" 
fill="url(MyDefFile.svg#Gradient01)"  />
</svg>

Is it allowed and what is the correct URI syntax?

Any advice appreciated,

Philippe Converset
Software Engineer
www.Qarbon.com
Received on Wednesday, 3 October 2001 07:29:10 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:21 GMT