xlink from SVG to HTML anchor in containing page

Discussion in 'XML' started by Anna, Apr 22, 2004.

  1. Anna

    Anna Guest

    Hello all.
    I hope this is the right group to ask my question.

    I have an HTML page that contains an SVG file in an object.
    Inside an SVG file I want to add a link to link to some anchor on
    the including HTML page. I tried to do it, but it doesn't seem to
    work.
    Here is my example:
    test.svg:
    <?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="700" height="400" xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <g>
    <rect width="100" height="50" x="330" y="180" fill="pink"/>
    <a xlink:href="test.html#end">
    <text x="358" y="205">
    <tspan>page </tspan>
    <tspan x="358" dy="15"> title</tspan>
    </text>
    </a>
    </g>
    <!-- Show outline of canvas using 'rect' element -->
    <rect x="0" y="0" width="700" height="400" fill="none" stroke="blue"
    stroke-width=".02cm"/>
    </svg>

    test.html:
    <html>
    <head>
    <title>test svg</title>
    </head>
    <body>
    <p>test svg</p>
    <object type="image/svg+xml" data="test.svg" width="500"
    height="500"></object>
    <p>test end</p>
    <a name="end"></a>
    </body>
    </html>

    When I click on the link in embedded SVG, just nothing happens.
    If I use a full URL of some site as the value of xlink:href, it works,
    but I want to use a local anchor.
    What is the right syntax to do this?

    Thank you very much for help
    Anna, Apr 22, 2004
    #1
    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. Anna
    Replies:
    1
    Views:
    850
    A. A. Golownew
    Apr 26, 2004
  2. Arne Nordmann
    Replies:
    0
    Views:
    520
    Arne Nordmann
    Jun 28, 2004
  3. Mardagg
    Replies:
    0
    Views:
    803
    Mardagg
    May 12, 2006
  4. Mardagg
    Replies:
    0
    Views:
    659
    Mardagg
    May 12, 2006
  5. milof83

    svg to svg saving problem

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

Share This Page