<html xmlns="http://www.w3.org/1999/xhtml" xmlns:foo="http://www.example.com/foo">
<script type="text/javascript">
<![CDATA[
function debug(str) {
li = document.createElementNS('http://www.w3.org/1999/xhtml', 'li');
li.appendChild(document.createTextNode(str));
document.getElementById('console').appendChild(li);
}
function runTests() {
if (window.testRunner)
testRunner.dumpAsText();
e = document.getElementById('test');
e.innerHTML = '<b>Success!</b><foo:bar></foo:bar>';
if (e.firstChild.namespaceURI == 'http://www.w3.org/1999/xhtml')
debug('namespace is correct')
else
debug('namespace is incorrect (' + e.firstChild.namespaceURI + ')');
if (e.lastChild.namespaceURI == 'http://www.example.com/foo')
debug('namespace is correct')
else
debug('namespace is incorrect (' + e.lastChild.namespaceURI + ')');
}
]]>
</script>
<body onload="runTests();">
<p>This tests that setting innerHTML on an xhtml document works and respects namespaces and unknown namespace prefixes. If this test is successful, the text below should say "Success", and "namespace is correct" TWICE.</p>
<p id="test"/>
<ul id="console"/>
</body>
</html>