Hi Aashish

Once you've describe an object in defs section, here Gr, it is 
considered as one single element.
So, when you use it by <use> element, you can't access to any child of 
this object.

On the other hand, in your example, if you change some attribute of the 
rect of "Gr", it will impact any reference to "gr", ie u1 AND u2, 
because you've changed the symbol itself.

You cannot apply modifications only to U1, and not to U2.


But:
if you have something like
<defs>
    <rect id="myrect" x="10" y="10" width="50" height="60"/>
</defs>

<use xlink:href="#myrect" id="U1">
<use xlink:href="#myrect" id="U2">

, you can define differents color for the two <use>. To do that , change 
the <use> attributes directly : 
doculent.getElementById('U1').setAttribute('fill','blue'), and not the 
definition of the referenced object.
That way, you can have different representation of a single referenced 
element. But you cannot change its définition.

Hope it helps

Jérôme Tricand de la Goutte

Société Logatique
50 rue Marcel Dassault
92100 Boulogne-Billancourt

01 46 21 59 59



Aashish Singhvi wrote:

>SVG gurus,
>
>If I have a SVG like:
><svg. ...>
><defs>
>   <g id="Gr">
>      <rect ....>
>      <text ....>
>   </g>
></defs>
>
><use id="U1" xlink:href="#Gr" ... />
><use id="U2" xlink:href="#Gr" ... />
>...
>
>For the object defined by ElementId = "U1", is there a way to access 
>the inherited children from "Gr". Meaning, is access to U1's 
>rectangle child or U1's text child allowed.
>svgdoc.getElementById("U1").childNodes doesn't give any elements.
>
>Is there another way to access those children? 
>If not, and I have to access the children elements for each rendered 
>element, (non-def), would defining a "g" element with actual 'rect' 
>and 'text' elements be the only way to achieve it?
>So, for above, I will be doing
>
>..
></defs>
><g id="U1"><rect .../><text ...>BLAH</text></g>
><g id="U2"><rect .../><text ...>BLAH</text></g>
>...
>
>TIA,
>Aashish
>
>
>
>
>
>
>
>
>-----
>To unsubscribe send a message to: [EMAIL PROTECTED]
>-or-
>visit http://groups.yahoo.com/group/svg-developers and click "edit my 
>membership"
>---- 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>  
>


-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to