XPointers in SVG

Posted by Nycto on Stack Overflow See other posts from Stack Overflow or by Nycto
Published on 2010-03-21T04:58:22Z Indexed on 2010/03/21 5:01 UTC
Read the original article Hit count: 300

Filed under:
|

I've been trying to get XPointer URIs working in an SVG file, but haven't had any luck so far. After trying something more complicated and failing, I simplified it down to just referencing an ID. However, this still fails.

The spec seems pretty clear about this implementation:

http://www.w3.org/TR/SVG/struct.html#URIReference

I found an example online of what should be a working XPointer reference within an svg document. Here is the Original. Here is the version I copied out:

<?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="500" height="200" version="1.1" 
    xmlns="http://www.w3.org/2000/svg" 
    xmlns:xlink="http://www.w3.org/1999/xlink">

    <defs>
        <rect id="simpleRect" width="100px" height="75px"/>
    </defs>
    <use xlink:href="#simpleRect" 
        x="50" y="50" style="fill:red"/>
    <use xlink:href="#xpointer(id('simpleRect'))" 
        x="250" y="50" style="fill:yellow"/>
</svg>

This should display two rectangles... one red and one yellow. I tried rendering with Firefox 3.6 and Inkscape 0.47. No success. Only the Red rectangle shows.

What am I missing?

Thanks for any help you can offer

© Stack Overflow or respective owner

Related posts about svg

Related posts about xpointer

  • PHP DOMXml XPath of recursive Xpointer

    as seen on Stack Overflow - Search for 'Stack Overflow'
    My xml document reflects an Object. as referential Recursion is possible in objects and arrays. I need to reflect that in reproduced XML Structure too. Currently I am using Unique IDs to identify each node separately and a node like <recursion refer="IDREF"> and specifying the ID of the referenced… >>> More

  • XPointers in SVG

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I've been trying to get XPointer URIs working in an SVG file, but haven't had any luck so far. After trying something more complicated and failing, I simplified it down to just referencing an ID. However, this still fails. The spec seems pretty clear about this implementation: http://www.w3.org/TR/SVG/struct… >>> More

  • Unable to install Xdebug

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I've registered xdebug in php.ini (as per http://xdebug.org/docs/install) but it's not showing up when i run "php -m" or when i get a test page to run "phpinfo()". I've just installed the latest version of XAMPP. Can anyone provide any suggestions in getting xdebug to show up? This is what i get… >>> More