Thomas,
as always thanks for the quick answer.
But I couldn't find mines.svg in any distribution.
On the other hand, looking at your code below - it's a script, right? But I cannot really use something like that since I am not using script (I am not sure really whether I've got this right)
But you got me to think. Maybe the solution is to add a listener separatelly to 'use' elements, and not add them to 'g' elements, then when user clicks on a symbol, event will contain the 'use' element. I'll try this.
 
Milan
=========================================
Milan Trninic
Software Engineer
tel: 1 604 484-2764, 484-2750
[EMAIL PROTECTED]
Galdos Systems Inc. http://www.galdosinc.com
=========================================

===============
Privileged or confidential information may be contained in this message. If this message was not intended for you, destroy it and notify us immediately. Opinions, conclusions, recommendations, and other information presented in this message are not given or necessarily endorsed by my employer or firm.

----- Original Message -----
Sent: Thursday, April 11, 2002 13:39
Subject: 'use' element and DOM structure

>>>>> "MT" == Milan Trninic <[EMAIL PROTECTED]> writes:

MT> Hi, does someone know how to figure out what School has user
MT> clicked on. In the following snippet:

MT> <g id="School" transform="scale(0.25)"> <path style="..."d="..."/>
MT> <path style="..." d="..."/> </g> <use
MT> transform="translate(0.0,400.0) scale(1)"
MT> xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#School"
MT> id="School.1"/> <use transform="translate(0.0,400.0) scale(1)"
MT> xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#School"
MT> id="School.2"/>

MT> There are two schools with IDs Schools.1 and School.2. When user
MT> clicks on one of them, the event contains the g element, not the
MT> 'use' element. Now I couldn't figure out how to follow the link
MT> backwards to the 'use' element.  The problem is that the SVG
MT> document contains 'use' elements without children ("non-exposed
MT> DOM tree" as the spec state), and g element which I can get from
MT> the event is the one under svg, not the cloned (non-exposed) one
MT> under 'use'.

    You can take a look at samples/mines.svg.

    In this example I do something like:

function handleClick(evt, id) {
  var e = doc.getElementById(id);
}


<g id="School" transform="scale(0.25)">         
    <path style="..."d="..."/>          
    <path style="..." d="..."/>      
</g>      
<use transform="translate(0.0,400.0) scale(1)"
    
     xlink:href="#School" id="School.1"/>   

<use transform="translate(0.0,400.0) scale(1)"
    
     xlink:href="#School" id="School.2"/>   

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to