<?xml version="1.0"?>
<?xml-stylesheet href="data:text/css,root{display:block}"?>
<root xmlns:html="http://www.w3.org/1999/xhtml">
 <html:title>xml:base evil test</html:title>
 <a xml:base="002a/">
  <html:style type="text/css">
   @import "style";
  </html:style>
  <html:img src="image" alt="FAIL"/>
  <html:script src="script"/>
 </a>
 <b xml:base="002b/"/>
 <html:p id="results">Loading... (If nothing happens, the script failed to bootstrap.)</html:p>
 <html:script type="application/x-javascript">
  document.getElementById('results').firstChild.data = "Running... (If nothing further happens, a script error occured.)";
  var a = document.getElementsByTagNameNS('', 'a')[0];
  var b = document.getElementsByTagNameNS('', 'b')[0];
  while (b.childNodes.length &lt; a.childNodes.length) {
    var newNode = a.childNodes[b.childNodes.length].cloneNode(true);
    if (newNode.nodeType == Node.ELEMENT_NODE &amp;&amp;
        newNode.localName == 'script' &amp;&amp;
        newNode.namespaceURI == 'http://www.w3.org/1999/xhtml') {
      newNode.addEventListener("load", function (e) {
        if (document.test instanceof Function) {
          document.test(document.getElementById('results'));
        } else {
          document.getElementById('results').firstChild.data = "FAIL";
        }
      }, false);
    }
    b.appendChild(newNode);
  }
 </html:script>
</root>
