Discussion Locked

XML root not always found

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

We are passing back XML from the database to an ASP page. The XMl is then manipulated using javascript to render the UI in the browser (IE5). The problem I have is that
var root = source.documentElement;
(where source is the id of the XML data island) does not always return the root of the XML even though the XML has been sent back and can be loaded into XML Notepad or IE by itself. Sometimes it obtains the root, sometimes it does not. To complicate matters, a couple of other pagesusing the same method to obtain the root always work without a problem.

Does anyone know why this happens and if so what solutions I can apply? Any help would be appreciated.

Thanks in advance.

Rohit

6 replies

by cybirdii

Raising the points - this is an urgent issue and I need an answer ASAP. Anybody?

by msteinhoff

I had a similar problem back in April that turned out to be a bug in IE5. The answer is explained in Microsoft article Q257723.

From the article:
This problem only occurs with Internet Explorer 5.01, and it usually happens when you access theXMLDOM of a large or complex inline XML data island.

I used the suggested work around:
Use the SRC attribute of the data island to point to a file instead of embedding the XML data directly in the data island itself. For example:

Not pretty, but unless you are sure of your users browser, you don't have much choice.
Mark

by cybirdii

Ummm - I added a response to the question instead of rating it from here. Duh!

Here it is though...
____________________________________

Thank you for the response. However, since we generate the XML on the fly (it is not static) and we have a significantly large user base, we did not want to keep generating XML files (thus increasing file I/O, etc).

We have since overcome this issue by streaming the XML to a COMMENT tag and then using the DOM API to loadXML from the comment. Now thecode works fine.

MS has said that 5.1 or 5.5 versions of IE should fix this issue.

Rohit

by cybirdii

Thank you for the response. However, since we generate the XML on the fly (it is not static) and we have a significantly large user base, we did not want to keep generating XML files (thus increasing file I/O, etc).

We have since overcome this issue by streaming the XML to a COMMENT tag and then using the DOM API to loadXML from the comment. Now the code works fine.

MS has said that 5.1 or 5.5 versions of IE should fix this issue.

Rohit

This discussion is closed to new replies.