You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by "K. W. Landry" <kw...@gmail.com> on 2006/11/10 03:47:22 UTC

Visibility of id within group element

Folks,
A quick sanity check, if you will.

Individual elements with an "id" attribute are completely visible through
the api via *.getid, *.getAttributeNodeNS, etc.... Take those same elements
and embed within a <g> element and the same elements are no longer
accessible via the very same "id" attribute as before.

I can't find a reference that states this is by design/spec, but is this
correct behavior, yes,no?


Thanks,

KWL

Re: Visibility of id within group element

Posted by th...@kodak.com.
Hi KWL,

"K. W. Landry" <kw...@gmail.com> wrote on 11/09/2006 09:47:22 PM:

> Individual elements with an "id" attribute are completely visible 
through the 
> api via *.getid, *.getAttributeNodeNS, etc....

   I'm not entirely sure what 'completely visible' means but yes you can
find elements that are attached to the document through the method
'getElementById'.

> Take those same elements and embed within a <g> element and the same 
> elements are no longer accessible via the very same "id" attribute as 
before. 

   Our implementation of getElementById only finds elements that are 
'connected' to the element that you are calling getElementById on.
This is only an important distinction if you have tree's of elements
that aren't attached to the main rendering tree (probably by having
called 'removeChild', but also potentially dynamically created but
not yet added with 'appendChild' to the main tree).

> I can't find a reference that states this is by design/spec, but is this 

> correct behavior, yes,no? 

   If the 'g' is part of the main tree than this should work (and always
has in my experience).


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org