Permalink
Browse files

createDocument: don't incorrectly set namespaceURI and qualfiedName o…

…n document; create a document element using the specified namespaceURI and qualifiedName, but only if a qualifiedName is specified.
  • Loading branch information...
1 parent a29a344 commit 63b3f11910049c18bb864ffd6a74a6a6e74385a5 @djcsdy djcsdy committed Feb 7, 2011
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/jsdom/level2/core.js
@@ -74,8 +74,6 @@ core.DOMImplementation.prototype.createDocument = function(/* String */ na
}
var document = new core.Document();
- document.namespaceURI = namespaceURI;
- document.qualifiedName = qualifiedName;
document.doctype = doctype || new core.DocumentType(document, 'xml');
if (!document.doctype.entities) {
@@ -84,8 +82,8 @@ core.DOMImplementation.prototype.createDocument = function(/* String */ na
document._ownerDocument = document;
- if (!doctype || doctype.name.toLowerCase().indexOf('xml') > -1) {
- var docElement = document.createElement('xml');
+ if (qualifiedName) {
+ var docElement = document.createElementNS(namespaceURI, qualifiedName);
document.appendChild(docElement);
}

0 comments on commit 63b3f11

Please sign in to comment.