Loading ...
Sorry, an error occurred while loading the content.
 

reuse in SVG

Expand Messages
  • nokiko nokiko
    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
    Message 1 of 3 , Apr 8, 2002
      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:

      <def>
      Symbol?

      other ways

      Armand



      _________________________________________________________________
      Join the world�s largest e-mail service with MSN Hotmail.
      http://www.hotmail.com
    • neumannandreas
      with within the content is not rendered, only the instances. alternatively you can just use xlink:href f.e.
      Message 2 of 3 , Apr 8, 2002
        with <symbol/> within <defs></defs> the content is not rendered, only
        the instances.

        alternatively you can just use xlink:href

        f.e.

        <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.

        Andreas

        --- 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
        "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:
        >
        > <def>
        > Symbol?
        >
        > other ways
        >
        > Armand
        >
        >
        >
        >
        _________________________________________________________________
        > Join the world's largest e-mail service with MSN Hotmail.
        > http://www.hotmail.com
      • Stephen Harwin
        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: defs element wont show via
        Message 3 of 3 , Apr 9, 2002
          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:
          " defs element wont show via javascript"

          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.

          HTH
          Steve
        Your message has been successfully submitted and would be delivered to recipients shortly.