I imagine it was overridden because the getElementById() defined by DOM HTML [1] (IDs are attributes named "id") has different behaviour than the one in DOM Core [2] (IDs are attributes of type ID). There probably wasn't much thought about making it efficient and since there's really no one maintaining the HTML DOM implementation it hasn't improved much over the years.
[1] http://www.w3.org/TR/1998/REC-DOM-Level-1-19981001/level-one-html.html [2] http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#ID-getElBId Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] Jacob Kjome <[EMAIL PROTECTED]> wrote on 09/22/2006 02:04:51 AM: > > I'm curious... > > If Xerces is keeping an internal Map of "identifiers" (in > CoreDocumentImpl), why does HTMLDocumentImpl need to override > getElementById(String) and recurse through the document looking for > an element with an "id" attribute with the value provided? Why not > just look it up from the "identifiers" map? Seems to me that would > be much more efficient. Is it because the "identifiers" map doesn't > get populated for HTMLDocumentImpl objects? If not, why > not? getElementById(String) is such a commonly used method that it > would make sense to implement it as efficiently as possible, don't you think? > > > Jake > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
