<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>Evil XML: Script Access to Framed XML (inner frame)</title>
  <script type="text/javascript">
  <![CDATA[
   var friend;
   function test() {
     friend = parent.test;
     window.setTimeout(poke, 2000);
   }
   function poke() {
     friend.document.documentElement.appendChild(friend.document.createTextNode('Hello World!'));
     friend.document.insertBefore(friend.document.createProcessingInstruction('xml-stylesheet', 'href="002b.css"'), friend.document.documentElement);
   }
   function bg() {
     if (friend.document.documentElement.attributes.getNamedItem('bg')) {
       friend.document.documentElement.attributes.removeNamedItem('bg');
     } else {
       friend.document.documentElement.setAttribute('bg', 'set');
     }
   }
   function addtext() {
     friend.document.documentElement.appendChild(friend.document.createTextNode(' Added more text!'));
   }
  ]]>
  </script>
 </head>
 <body onload="test()">
  <p>A second frame should be visible. Initially it just contains the
  seven-character XML file "&lt;text/&gt;". It is dynamically
  populated with an XML stylesheet PI and some text after two seconds.
  The following buttons allow you to dynamically toggle attributes and
  add new text nodes. </p>
  <p>
   <input type="button" value="Change Background" onclick="bg()"/>
   <input type="button" value="Add Text" onclick="addtext()"/>
  </p>
 </body>
</html>

