xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joe Sabu" <Joe.S...@dothill.com>
Subject Re: getElementById
Date Thu, 09 Nov 2000 17:51:29 GMT
There're more dangers with the current implementation of getElementById().

For one, if you do a removeChild on an Element which has an ID attribute, a
subsequent getElementById() still returns the deleted node. This is BAD!!
Apparently, getElementById is based on a HashTable of ID-values vs. Element
Refs, which is only touched on parsing time. Any programatical
createElement/removeElement etc. is not modifying this table.

Would anybody from xerces group advice on the validity of the current
implementation? or any workarounds or suggestions, please.


Joe Sabu
----- Original Message -----
From: "Jophy & Sabu" <jophyjoe@sprintmail.com>
To: <general@xml.apache.org>
Sent: Wednesday, November 08, 2000 7:47 PM
Subject: getElementById


    After I add an Element with appendChild, if I try a doc.getElementById
for retrieving the just added element, it does not succeed (returns null).
Is this a known issue?  however, if I serialize the document, and read it
back, then the new node is seen by the getElementById.

How can I retrieve a node which I just added programatically?

Joe Sabu

In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org

View raw message