[XML-SIG] Why is Builder.push() the way it is?

Andrew M. Kuchling akuchlin@cnri.reston.va.us
Thu, 3 Dec 1998 14:52:31 -0500 (EST)


Michael Sanborn writes:
>Now, as far as I can see from the DOM spec and the definition of
>_LEGAL_DOCUMENT_CHILDREN, if nodetype is in _LEGAL_DOCUMENT_CHILDREN,
>nodetype will never be equal to TEXT_NODE. I was rather imagining that
>this section would read:

	Hmm... Actually, you're not mistaken; that code does look
suspicious.  Thanks for the bug report!  Certainly there's nothing
clever going on the covers that makes that code reasonable.  I'll do
some archaeology in the CVS logs and try to figure out when the
problem crept in, and fix it.  (Maybe not in time for the 0.5 release,
though.)

>As a second, minor question, why does one sometimes use
>appendChild(node) and other times insertBefore(node, None)?

	appendChild(node) actually just calls insertBefore(node,
None), so there's no real difference other than the extra method call.
If you were trying to do something very high-performance, you might
use the latter form just to avoid the extra function call, but for
most uses it doesn't matter.

-- 
A.M. Kuchling			http://starship.skyport.net/crew/amk/
I suppose I had vaguely hoped that you had changed, my brother. That you'd
noticed that there were other people in the world. That you had begun to see
people as other than things that dream, as creatures of stories.
    -- Destruction to Dream, in SANDMAN #48: "Brief Lives:8"