I'm having trouble with XML in IE.
I wrote the following function and it works fine in Firefox, but when I
try to run it in IE, I get the error "getElementsByTagName(..).0' is
null or not an object." at the line var
orgList=window.document.getElementsByTagName("xml" )"
The xml is embedded into the page and bracketed by <div><xml> and
</xml></div> tags and, as I said, it is working fine in Firefox.
function loadOrgOptions() {
var orgList =
window.document.getElementsByTagName("xml")[0].getElementsByTagName("orglist")[0].getElementsByTagName("office");
document.frmSubmission.ddOffice.options.length = 0;
document.frmSubmission.ddOffice.options[0] = new Option ("Please
select", "0", true, true);
for (var i = 0; i < orgList.length; i++) {
var xmlThisOrg = orgList[i];
var strValue =
xmlThisOrg.getElementsByTagName("officeIdent")[0].firstChild.data;
var strText =
xmlThisOrg.getElementsByTagName("officeName")[0].firstChild.data;
document.frmSubmission.ddOffice.options[i+1] = new Option (strText,
strValue, false, false);
}
}