How to attach "load" events before the body node is there

I've read through DOM3 Events and DOM3 Load and Save, as well as previous
e-mails on this issue [1], but haven't found a solution to this problem.

If, within a script, I am handed an XHTML or arbitrary XML document that
is in the process of being constructed, how can I hook an event handler so
that I am notified when the document has finished loading?

Note that in the case of an XHTML document, the <body> node will not yet
have been parsed and added to the DOM at this stage (and in the XML case,
there is of course no <body> node). And unless I have missed something in
the case of DOM3 Load and Save, I have no way of getting to the object
that is constructing the document in order to add the event listener to
that object.

It would be great if the specs could be clarified on this issue.

Cheers,

-- References --
[1] http://lists.w3.org/Archives/Public/www-dom/2003AprJun/0057.html

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
U+1047E                                         /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 11 September 2003 13:08:24 UTC