How to determine when loading an xml file is completed?

"Roy wang" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xml
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
hi,
I want to load an xml file using javascript in a web page.
And I use firefox 0.9.3 to visit the page.

The code below is load the xml file.
    this.xmlDoc = document.implementation.createDocument("","doc",null);
    this.xmlDoc.load(url);

I want to make sure the xml file is loaded successfully, or to time out at 5 
seconds.
there is no property such as this.xmlDoc.readyState to check.

Is this.xmlDoc.onload a good way to detect the completion of loading?
What if i have to time out the loading after 5 seconds?

Any suggestion?

Thanks,
Roy
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.