- From: Jonathan Chetwynd <j.chetwynd@btinternet.com>
- Date: Mon, 4 Aug 2003 18:05:57 +0100
- To: www-svg@w3.org
should linking be inherited with <use> ?
In some cases it would help maintenance when updating linked graphics
across a site:
file1.svg
<svg>
<use x='5' y='5' xlink:href='file2.svg#rect1' />
<use x='30' y='30' xlink:href='file2.svg#rect1' />
</svg>
file2.svg like this does not work:
<svg>
<defs>
<g id='rect1'>
<a xlink:href="http://www.peepo.com/alfi-x/reading.html">
<rect width='15' height='15' style='fill:red' />
</a>
</g>
</defs>
</svg>
even in the same file links are not inherited from a <use>d element,
either in ASV3 or 6pr, though it does seem to work in the latest Corel
viewer.
file3.svg
<svg>
<defs>
<rect id='rect1' width='15' height='15' style='fill:red' />
<g id='rect2'>
<a xlink:href="http://www.peepo.com/alfi-x/reading.html">
<circle cx='15' cy='15' r='10' style='fill:orange; '/>
<rect width='15' height='15' style='fill:blue' />
</a>
</g>
</defs>
<use x='5' y='5' xlink:href='#rect1' />
<use x='30' y='30' xlink:href='#rect2' />
<a xlink:href="http://www.peepo.com/alfi-x/reading.html">
<use x='60' y='50' xlink:href='#rect2' />
</a>
</svg>
Jonathan
thanks to Doug Schepers for reading the spec*, testing on Corel and
providing most of the code! any errors are mine
*SVG1.1-5.6: "The 'use' element references another element and
indicates that the
graphical contents of that element is included/drawn at that given
point in
the document."
Received on Monday, 4 August 2003 13:01:57 UTC