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

tag to include SVG s from another file

Expand Messages
  • AndrewB
    Hi I am try to make use of several definitions of icons, specified as groups within the section of a file. If I include the content within
    Message 1 of 3 , May 27 8:32 AM
    • 0 Attachment
      Hi
      I am try to make use of several definitions of icons, specified as
      groups <g> within the <defs> section of a file.

      If I include the <defs> content within the SVG file I want to use the
      icons in, the image is rendered in all the browsers I have tried
      (Safari 5.0.5, firefox 4.01, Chrome 11.0.696.71).

      However, if I put the <defs> content in another file, and refer to the
      icons via the <use> tag, the only browser of the three that displays the
      icons is Firefox.

      For example, if I have a SVG file which contains my <defs> section and
      put
      <use xlink:href="#activity" x="240" y="100" width="32" height="32"
      id="activity1icon" />
      then the icon defined is rendered in all 3 browsers, whereas if I put
      the <defs> in an external file cld-icons.svg and refer like this
      <use xlink:href="cld-icons.svg#activity" x="240" y="100" width="32"
      height="32" id="activity1icon" />
      the only browser which displays the icons is Firefox.

      Am I making a mistake in my coding, or is Firefox the only browser which
      will load <defs> from external files?

      Thee are two examples avaialble here:
      http://www.basher-sounds.co.uk/ou/svg/one-file-no-scripts/
      <http://www.basher-sounds.co.uk/ou/svg/one-file-no-scripts/%20>
      one for the <defs> within the file, the other for <defs> in an external
      file.

      The ability to refer to one set of icon definitions from many SVG files
      is really useful, so I am hoping it's my coding which is at fault!

      I hope some one in the group will let me know.

      I've seen from searching this group that there's awhat likes like a
      relevant bug in Chrome (https://bugs.webkit.org/show_bug.cgi?id=12499
      <https://bugs.webkit.org/show_bug.cgi?id=12499> ) that remains unfixed.

      Thanks for any advice

      Andrew



      [Non-text portions of this message have been removed]
    • Francis Hemsher
      ... Hi Andrew, Both Firefox and Opera currently support this very important feature. As you pointed out, svg libraries will be messy to access without this
      Message 2 of 3 , May 28 2:09 PM
      • 0 Attachment
        --- "AndrewB" <a.j.brasher@...> wrote:

        > Am I making a mistake in my coding, or is Firefox the only browser which
        > will load <defs> from external files?
        >
        > The ability to refer to one set of icon definitions from many SVG files
        > is really useful, so I am hoping it's my coding which is at fault!
        >

        Hi Andrew,
        Both Firefox and Opera currently support this very important feature.
        As you pointed out, svg libraries will be messy to access without this feature.
        Hopefully, IE10 will also include it(I sent a bug report).
        Regards,
        Francis
      • AndrewB
        Hi Francis Thanks for confirming my fear. Let s hope hope that IE10 and the others (Safrai and Chrome) implement this feature. Best wishes Andrew
        Message 3 of 3 , Jun 1, 2011
        • 0 Attachment
          Hi Francis

          Thanks for confirming my fear. Let's hope hope that IE10 and the others (Safrai and Chrome) implement this feature.

          Best wishes

          Andrew

          --- In svg-developers@yahoogroups.com, "Francis Hemsher" <fhemsher@...> wrote:
          >
          > --- "AndrewB" <a.j.brasher@> wrote:
          >
          > > Am I making a mistake in my coding, or is Firefox the only browser which
          > > will load <defs> from external files?
          > >
          > > The ability to refer to one set of icon definitions from many SVG files
          > > is really useful, so I am hoping it's my coding which is at fault!
          > >
          >
          > Hi Andrew,
          > Both Firefox and Opera currently support this very important feature.
          > As you pointed out, svg libraries will be messy to access without this feature.
          > Hopefully, IE10 will also include it(I sent a bug report).
          > Regards,
          > Francis
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.