reuse in SVG
- Hi all
What is the best way to reuse elements in svg. I have a lot of "building
blocks" that can be used to create models with. However these can be used
and abused ( rotation scale etc).
What is the best way to use this:
Join the world�s largest e-mail service with MSN Hotmail.
- with <symbol/> within <defs></defs> the content is not rendered, only
alternatively you can just use xlink:href
<path id="bezgrenz23" style="&bezgrenzstyle;" d="M 623294
-422091 L 623305 -422065 L 623388 -421887 ........... -422111 L
623210 -422109 L 623231 -422106 L 623284 -422092 L 623291
-422087 L 623294 -422091 "></path>
<use xlink:href="#bezgrenz23" style="&bezgrenznewstyle;" />
this allows to reuse geometry with overriding styles
very useful also in cartography, where you have the same geometry
with different styles.
--- In svg-developers@y..., "nokiko nokiko" <armand.d@w...> wrote:
> Hi all
> What is the best way to reuse elements in svg. I have a lot of
> blocks" that can be used to create models with. However these can
> and abused ( rotation scale etc).
> What is the best way to use this:
> other ways
> Join the world's largest e-mail service with MSN Hotmail.
- Hi Armand,
I have been using the use element and I had a problem that you might run across...You should look at the thread:
Kevin Lindsey expalined that I needed to use the
myElement.setAttributeNS("http://www.w3.org/1999/xlink", "href","#mySymbol" );
in order to get my CSS classes to apply to the use element.