| pre = document.getElementById('console'); |
| txt = document.createTextNode(str) |
| var xhtmlURI = 'http://www.w3.org/1999/xhtml' |
| var doc = document.implementation.createDocument(xhtmlURI, 'html', null) |
| if (!doc.documentElement) { |
| debug('FAILURE: document has no document element') |
| if (doc.documentElement.nodeName != 'html') { |
| debug('FAILURE: document element has wrong name') |
| if (doc.documentElement.namespaceURI != xhtmlURI) { |
| debug('FAILURE: document element has wrong namespace URI') |
| <body onload="runTests();"> |
| This tests that a document created by createDocument has a document element, and that the document element has the correct name and namespace URI. If the test is successfull, 'SUCCESS' will be displayed below, otherwise 'FAILURE' and a reason will be displayed. |