Author karlcow
Recipients Alexander.Tobias.Heinrich, jkloth, karlcow
Date 2019-09-26.12:45:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1569501920.52.0.749029565039.issue18182@roundup.psfhosted.org>
In-reply-to
Content
The current specification as of today documents
https://dom.spec.whatwg.org/#dom-document-createelementns


If you run this in the browser console, 

var nsdoc = 'http://foo.bar/zoo';
var xmldoc = document.implementation.createDocument(nsdoc, 'Zoo', null);
var cpd = document.createElementNS(nsdoc, 'Compound');
var chimp = document.createElementNS(nsdoc, 'Chimp');
cpd.appendChild(chimp)
xmldoc.documentElement.appendChild(cpd);

/* serializing */
var docserializer = new XMLSerializer();
var flatxml = docserializer.serializeToString(xmldoc);
flatxml


you get:

<Zoo xmlns="http://foo.bar/zoo">
  <Compound>
    <Chimp/>
  </Compound>
</Zoo>


but if you run this in the browser console,

var nsdoc = 'http://foo.bar/zoo';
var xmldoc = document.implementation.createDocument(nsdoc, 'Zoo', null);
var cpd = document.createElement('Compound');
var chimp = document.createElement('Chimp');
cpd.appendChild(chimp)
xmldoc.documentElement.appendChild(cpd);

/* serializing */
var docserializer = new XMLSerializer();
var flatxml = docserializer.serializeToString(xmldoc);
flatxml


you get:


<Zoo xmlns="http://foo.bar/zoo">
  <compound xmlns="http://www.w3.org/1999/xhtml">
    <chimp></chimp>
  </compound>
</Zoo>


which is a complete different beast.


I don't think there is an issue here. And we can close this bug safely.
History
Date User Action Args
2019-09-26 12:45:20karlcowsetrecipients: + karlcow, jkloth, Alexander.Tobias.Heinrich
2019-09-26 12:45:20karlcowsetmessageid: <1569501920.52.0.749029565039.issue18182@roundup.psfhosted.org>
2019-09-26 12:45:20karlcowlinkissue18182 messages
2019-09-26 12:45:20karlcowcreate