W3C home > Mailing lists > Public > www-svg@w3.org > November 2004

Re: SVG 1.2 Comment: sXBL and element ids

From: Peter Sorotokin <psorotok@adobe.com>
Date: Thu, 04 Nov 2004 10:30:19 -0800
To: ralf@audiofarm.de, www-svg@w3.org
Message-id: <5.2.0.9.2.20041104102816.03217cc0@mailsj-v1.corp.adobe.com>

At 05:00 PM 11/4/2004 +0100, ralf@audiofarm.de wrote:

> >From the specification it's not clear to me (i.e. I can't find it), how
>one would elegantly access an element by its id within a sXBL template
>instance.
>
>Example:
>-----------------------------------------------
>
><xbl:xbl>
>    <xbl:definition element="audiofarm:knob">
>       <circle id="innerRing" />
>       <circle id="outerRing" />
>       <text id="channelLabel" />
>    </xbl:definition>
></xbl:xbl>
>
><audiofarm:knob id="knob1" />
><audiofarm:knob id="knob2" />
><audiofarm:knob id="knob3" />
>
>-----------------------------------------------
>
>How would one access the "innerRing" element of "knob2"?
>
>I think of something like getElementById("knob2.innerRing") - is there
>such a mechanism in SVG 1.2?

document.getElementById("knob2").xblShadowTree.getElementById("innerRing")

Note that accessing xblShadowTree more or less should be left to component 
code only so that you can change implementation later on.

Peter


>ralf ...
Received on Thursday, 4 November 2004 18:31:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:14:52 UTC