[Twisted-Python] (incorrect) code duplication in microdom

Cory Dodt corydodt at yahoo.com
Mon Feb 3 18:55:49 EST 2003

I just noticed that microdom.Element.getElementsByTagName doesn't behave
like domhelpers.getElementsByTagName; that is, it's not recursive.  (This
is even documented in the method's docstring.)

Also, microdom.Document.getElementsByTagName has yet another
implementation, and this one is recursive, but incorrect.

*Neither of these implementations obeys w3c*, which
domhelpers.getElementsByTagName does.  It would be trivial to change both
to use that code instead of doing it on their own, but microdom doesn't
import domhelpers, and I assume this is intentional.

Should microdom import domhelpers and use that code?  We'll gain
correctness,  and maybe maintainability, but create a circular dependency.
 Alternately, the method could be moved into microdom as a top-level
function, which the respective methods use.  Domhelpers could import this
method into its own namespace, keeping everyone happy.

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.

More information about the Twisted-Python mailing list