Connecting Tech Pros Worldwide Help | Site Map

getElementsByTagName returns empty list in IE

Newbie
 
Join Date: Feb 2009
Posts: 2
#1: Feb 9 '09
I have a problem with XML in IE7 that I cannot understand. To keep it simple, I have loaded an XML document from the server and extracted some data successfully using getElementsByTagName. This works on both IE and Mozilla based browsers.

I now want to add this data to a second XML document. I have loaded the document, use getElementsByTagName to locate where the data should go then add it. This works with Mozilla but IE returns an empty list suggesting it can't find the tag.

Anybody know why the method should work on the first document but not the second, yet works perfectly on both documents with Mozilla?

Many Thanks
Moderator
 
Join Date: Mar 2006
Posts: 1,103
#2: Feb 9 '09

re: getElementsByTagName returns empty list in IE


Would have to see the code. Could be any of a number of things.
Newbie
 
Join Date: Feb 2009
Posts: 2
#3: Feb 9 '09

re: getElementsByTagName returns empty list in IE


Thanks for the offer but I finally solved i. The problem was that the XML had an xsl-stylesheet with type="text/xml" and of course IE doesn't like this so got an empty responseXML and hence the empty list.
Reply