SVG and HTML links

Discussion in 'XML' started by Richard, Nov 1, 2004.

  1. Richard

    Richard Guest

    I have a SVG document with links out to html pages which works when
    you run the SVG file i have tried to intergrate it into a coldfusion
    page and the links no longer work.

    The SVG file is :

    <?xml version="1.0"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
    "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
    <svg width="250" height="250">
    <a xlink:href="http://www.google.com">
    <rect fill="#00ffff" stroke="#000000" stroke-width="0" x="30" y="30"
    width="100" height="100"/>
    </a>
    <a xlink:href="http://www.yahoo.com">
    <text fill="#000000" stroke="#000000" stroke-width="0" font-size="24"
    font-family="@MS Mincho" x="30px" y="163px">Link to
    yahoo</text>
    </a>
    </svg>

    If you double click the file it opens in IE and works fine, but when i
    copied the above code into a coldfusion page and added the usual
    namespace code:

    <html xmlns:svg="http://www.w3.org/2000/svg">
    <object id="AdobeSVG"
    classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2"></object>
    <?import namespace="svg" implementation="#AdobeSVG"?>

    Then modifed the code to include the <svg: tag it no longer works, the
    code is below:

    <svg:svg width="250" height="250">
    <svg:rect fill="#00ffff" stroke="#000000" stroke-width="0" x="30"
    y="30"
    width="100" height="100"/>
    <svg:a xlink:href="http://www.google.com">
    <svg:rect fill="#00ffff" stroke="#000000" stroke-width="0" x="30"
    y="30"
    width="100" height="100"/>
    </svg:a>
    <svg:a xlink:href="http://www.yahoo.com">
    <svg:text fill="#000000" stroke="#000000" stroke-width="0"
    font-size="24"
    font-family="@MS Mincho" x="30px" y="163px">Link to yahoo</svg:text>
    </svg:a>
    </svg:svg>

    Any ideas why the links don't work when i intergrate the code into the
    CFM page?

    Regards

    Richard
    Richard, Nov 1, 2004
    #1
    1. Advertising

  2. Richard wrote:

    > I have a SVG document with links out to html pages which works when
    > you run the SVG file i have tried to intergrate it into a coldfusion
    > page and the links no longer work.
    >
    > The SVG file is :
    >
    > <?xml version="1.0"?>
    > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
    > "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
    > <svg width="250" height="250">
    > <a xlink:href="http://www.google.com">
    > <rect fill="#00ffff" stroke="#000000" stroke-width="0" x="30" y="30"
    > width="100" height="100"/>
    > </a>
    > <a xlink:href="http://www.yahoo.com">
    > <text fill="#000000" stroke="#000000" stroke-width="0" font-size="24"
    > font-family="@MS Mincho" x="30px" y="163px">Link to
    > yahoo</text>
    > </a>
    > </svg>
    >
    > If you double click the file it opens in IE and works fine, but when i
    > copied the above code into a coldfusion page and added the usual
    > namespace code:
    >
    > <html xmlns:svg="http://www.w3.org/2000/svg">
    > <object id="AdobeSVG"
    > classid="clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2"></object>
    > <?import namespace="svg" implementation="#AdobeSVG"?>
    >
    > Then modifed the code to include the <svg: tag it no longer works, the
    > code is below:
    >
    > <svg:svg width="250" height="250">
    > <svg:rect fill="#00ffff" stroke="#000000" stroke-width="0" x="30"
    > y="30"
    > width="100" height="100"/>
    > <svg:a xlink:href="http://www.google.com">
    > <svg:rect fill="#00ffff" stroke="#000000" stroke-width="0" x="30"
    > y="30"
    > width="100" height="100"/>
    > </svg:a>
    > <svg:a xlink:href="http://www.yahoo.com">
    > <svg:text fill="#000000" stroke="#000000" stroke-width="0"
    > font-size="24"
    > font-family="@MS Mincho" x="30px" y="163px">Link to yahoo</svg:text>
    > </svg:a>
    > </svg:svg>
    >
    > Any ideas why the links don't work when i intergrate the code into the
    > CFM page?


    What about the xlink namespace, don't you need to declare that too?

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Nov 1, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arne Nordmann
    Replies:
    0
    Views:
    520
    Arne Nordmann
    Jun 28, 2004
  2. Mardagg
    Replies:
    0
    Views:
    803
    Mardagg
    May 12, 2006
  3. Mardagg
    Replies:
    0
    Views:
    659
    Mardagg
    May 12, 2006
  4. milof83

    svg to svg saving problem

    milof83, Aug 18, 2006, in forum: Java
    Replies:
    1
    Views:
    820
    Roland de Ruiter
    Aug 18, 2006
  5. Helmut Jarausch

    Re: svg-chart 1.1 SVG Charting Library

    Helmut Jarausch, May 20, 2008, in forum: Python
    Replies:
    0
    Views:
    471
    Helmut Jarausch
    May 20, 2008
Loading...

Share This Page