W3C home > Mailing lists > Public > www-svg@w3.org > March 2003

Re: SVG - links?

From: <AndrewWatt2001@aol.com>
Date: Thu, 6 Mar 2003 05:34:51 EST
Message-ID: <193.16c8c46d.2b987e4b@aol.com>
To: DHohls@csir.co.za, www-svg@w3.org
In a message dated 06/03/2003 09:51:18 GMT Standard Time, DHohls@csir.co.za 
writes:


> Andrew
>  
> Thanks for this - yes, it does produce what I want, but misses
> what I am trying to achieve.
>  
> I only want to create *one* <rect> 

You had three in your original code, so I assumed that was what you intended.

and then be able to move > 
> *and* resize or recolor it as I need; otherwise there is little or
> no point in having the <use> element at all, that I can see, and
> the SVG agains becomes long-winded and harder to maintain.
>  
> Can you help with this approach

Something like this?

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" 
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="600" height="400"
xmlns="http://www.w3.org/2000/svg">
 <desc>Local URI references within ancestor's 'defs' element.</desc>
 <defs>
  <linearGradient id="Gradient01">
   <stop offset="20%" stop-color="#39F" />
   <stop offset="90%" stop-color="#F3F" />
  </linearGradient>
    <linearGradient id="Gradient02">
   <stop offset="20%" stop-color="#990066" />
   <stop offset="50%" stop-color="#CCCCCC" />
   <stop offset="90%" stop-color="#660099" />
  </linearGradient>
  <rect id="rect1" x="-60" y="-20" width="120" height="40"  />
 </defs>
 <!-- test xlink -->
 <use xlink:href="#rect1" fill="url(#Gradient01)" 
transform="translate(100,60)"/>
 <use xlink:href="#rect1" fill="url(#Gradient01)" transform="scale(0.33,1) 
translate(180,110) "  />
 <use xlink:href="#rect1" y="2.2cm" fill="url(#Gradient02)" 
transform="scale(1,4) translate(100, -25)" />
 <!-- Show outline of canvas using 'rect' element -->
 <rect x="0" y="0" width="598" height="398"
   fill="none" stroke="blue" stroke-width="1" />
</svg>


 or, failing that point me to
> 
> a reasonable description of the role and limits(?) of  the <use>
> element?

I don't know of a description of the <use> element that is complete and 
"reasonable". Chapter 5.6 of the SVG 1.0 Recommendation certainly isn't 
"reasonable" in terms of comprehensibility for many readers.

I have written a couple of short tutorials on the <use> element in Designing 
SVG Web Graphics and in SVG Unleashed but those descriptions are 
introductions to it, making no attempt to be exhaustive.

I hope that helps.

Andrew Watt

>  
> Thanks
> Derek
> 
Received on Thursday, 6 March 2003 05:35:27 GMT

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