Closed
Bug 419558
Opened 18 years ago
Closed 15 years ago
error when loading xml file
Categories
(Firefox :: General, defect)
Tracking
()
RESOLVED
INCOMPLETE
People
(Reporter: saraaku, Unassigned)
Details
(Whiteboard: [CLOSEME 2010-07-30])
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
Hello,
I am wroking on an xml program. I tried to load my file using this formula that I got from the W3schools site...
function loadXMLDoc(dname)
{
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
xmlDoc=document.implementation.createDocument("","",null);
}
catch(e) {alert(e.message)}
}
try
{
xmlDoc.async=false;
xmlDoc.load(dname);
return(xmlDoc);
}
catch(e) {alert(e.message)}
return(null);
}
When I loaded my page into my browser, I got the following error
Component failure code:
0x80520012 (NS_ERROR_FILE_NOT_FOUND)
[nsIDOMXMLDocument.load]
I could not load the page and use the XML DOM to access nodes.
When I used this function, it worked --I did not get an error:
<script type="text/javascript">
var xmlDoc;
try //Internet Explorer
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
catch(e)
{
try //Firefox, Mozilla, Opera, etc.
{
xmlDoc=document.implementation.createDocument("","",null);
}
catch(e) {alert(e.message)}
}
try
{
xmlDoc.async=false;
xmlDoc.load("akua.xml");
document.write(xmlDoc.getElementsByTagName("title")
[0].childNodes[0].nodeValue);
document.write("<br />");
document.write(xmlDoc.getElementsByTagName("author")
[0].childNodes[0].nodeValue);
document.write("<br />");
document.write(xmlDoc.getElementsByTagName("year")
[0].childNodes[0].nodeValue);
}
catch(e) {alert(e.message)}
</script>
I surfed the web and noticed that others had the same problem. I think that the error is in the browser, maybe a missing file or something. Can you please fix it or make it easier for xml parser object to be created on your browser -- maybe you can make your next browser have the capability of automatically reading xml files so that programmers will not have to create a parser object at all. By this, I mean maybe you can make the browser read an xml file as it currently reads an html file and javascript files now. Thanks
Reproducible: Always
Steps to Reproduce:
1. Create an xml file of your own, load it into it using the two methods. My browser when I used the function to load my xml page, I got the error, when I used the non-function method, no error occurred
2.
3.
Expected Results:
The browser should have read the file and produced the results
This is the page with the file information and formula used
http://www.w3schools.com/dom/dom_loadxmldoc.asp
Comment 1•15 years ago
|
||
This bug was originally reported on Firefox 2.x or older, which is no longer supported and will not be receiving any more updates. I strongly suggest that you update to Firefox 3.6.6 or later, update your plugins (flash, adobe, etc.), and retest in a new profile. If you still see the issue with the updated Firefox, please post here. Otherwise, please close as RESOLVED > WORKSFORME
http://www.mozilla.com
http://support.mozilla.com/kb/Managing+profiles
http://support.mozilla.com/kb/Safe+mode
Whiteboard: [CLOSEME 2010-07-30]
Version: unspecified → 2.0 Branch
Comment 2•15 years ago
|
||
No reply, INCOMPLETE. Please retest with Firefox 3.6.8 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•