Closed Bug 504531 Opened 15 years ago Closed 13 years ago

default namespace is dropped when using setAttribute('xmlns', 'http://mynamespace')

Categories

(Firefox :: General, defect)

x86
Windows Vista
defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: ageorgousakis, Unassigned)

Details

(Whiteboard: [CLOSEME 2011-1-1])

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1) Gecko/20090624 Firefox/3.5 (.NET CLR 3.5.30729)

The following code doesn't produce the desired xml after Firefox 3 (3.5 also). 

doc = document.implementation.createDocument("", "", null);
root = doc.createElement("root");
root.setAttribute("xmlns", "http://mynamespace/");
doc.appendChild(root);
serializer = new XMLSerializer();
alert(serializer.serializeToString(doc)); 


Reproducible: Always

Steps to Reproduce:
The following javascript code works fine in IE, Chrome, Firefox 1.x, Firefox 2.x but not in Firefox 3.x.

<html>
<body>
<script language="javascript" type="text/javascript">
doc = document.all ? new ActiveXObject("MSXML.DOMDocument") : document.implementation.createDocument("", "", null);
root = doc.createElement("root");
root.setAttribute("xmlns", "http://mynamespace/");
root.appendChild(doc.createTextNode('test'));
doc.appendChild(root);
if (document.all) {
	alert(root.xml);
} else {
	var serializer = new XMLSerializer();
	alert(serializer.serializeToString(doc)); 
}
</script>
</body>
</html> 
Actual Results:  
<root>test</root>

Expected Results:  
<root xmlns="http://mynamespace/">test</root>
Reporter, are you still seeing this issue with Firefox 3.6.12 or later in safe mode? If not, please close. These links can help you in your testing.
http://support.mozilla.com/kb/Safe+Mode
http://support.mozilla.com/kb/Managing+profiles
Also, please consider using the most recent Firefox 4 beta build, your bug may be resolved there.
Whiteboard: [CLOSEME 2011-1-1]
No reply, INCOMPLETE. Please retest with Firefox 3.6.13 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: 13 years ago
Resolution: --- → INCOMPLETE
Same issue is in firefox 9.0.1
You need to log in before you can comment on or make changes to this bug.