svg - adding use tag

Discussion in 'XML' started by tino.cindric@gmail.com, Jul 12, 2006.

  1. Guest

    SVG structure

    <g id="someID" gmwmsvg:typ="l" gmwmsvg:pri="1000">
    <g id="gwmg4" class="D5F2B3w3j6" gmwmsvg:hi="D5F2B3w3j6 R2v1p1o6r3">
    <use xlink:href="#D5F2B3w3j6" x="9916" y="2711"
    gmwmsvg:act="JavaScript:SetFeatureID('P' + '10380');"></use>
    <use xlink:href="#D5F2B3w3j6" x="6995" y="2834"
    gmwmsvg:act="JavaScript:SetFeatureID('P' + '10390');"></use>
    <use xlink:href="#D5F2B3w3j6" x="4644" y="3775"
    gmwmsvg:act="JavaScript:SetFeatureID('P' + '10379');"></use>
    <use xlink:href="#D5F2B3w3j6" x="8604" y="6546"
    gmwmsvg:act="JavaScript:SetFeatureID('P' + '10375');"></use>
    </g>
    </g>

    Code: (variable X,Y,sAction appropriately set)

    ele=doc.getElementById("someID");
    nodes=ele.getElementsByTagName("g");
    ch=doc.createElement("use");
    ch.setAttribute("xlink:href",nodes.item(0).getAttribute("class"));
    ch.setAttribute("x",X);
    ch.setAttribute("y",Y);
    ch.setAttribute("gmwmsvg:act",sAction);
    nodes.item(0).appendChild(ch);

    nothing happens - any ideas?
     
    , Jul 12, 2006
    #1
    1. Advertising

  2. Martin Honnen, Jul 12, 2006
    #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. shruds
    Replies:
    1
    Views:
    870
    John C. Bollinger
    Jan 27, 2006
  2. Arne Nordmann
    Replies:
    0
    Views:
    542
    Arne Nordmann
    Jun 28, 2004
  3. Mardagg
    Replies:
    0
    Views:
    818
    Mardagg
    May 12, 2006
  4. Mardagg
    Replies:
    0
    Views:
    679
    Mardagg
    May 12, 2006
  5. no_ti

    svg - adding use tag

    no_ti, Jul 12, 2006, in forum: Javascript
    Replies:
    2
    Views:
    115
    no_ti
    Jul 12, 2006
Loading...

Share This Page