<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:xbl='http://www.w3.org/ns/xbl'
      xmlns:xhtml="http://www.w3.org/1999/xhtml">
  <head>
   <style>
    #test1 { background-color: red; }
   </style>
    <title>XBL 2.0 Test Suite: addBinding + handlers</title>
    <xbl xmlns="http://www.w3.org/ns/xbl">
     <binding id="b1">
      <template> 
       <xhtml:div>--&gt;<content/>&lt;-- now and this line should turn green.</xhtml:div>
      </template> 
     </binding>
     <binding id="b2">
      <handlers>
       <handler id="hand1" event="click">
         document.getElementById("test1").setAttribute("style", "background-color: green");
       </handler>
      </handlers>
    </binding>
     <binding id="b3" element="h1">
      <handlers>
        <handler id="hand2" event="click">
         document.getElementById("test1").addBinding("#b1");
         document.getElementById("test2").addBinding("#b2");
        </handler>
      </handlers>
    </binding>
    </xbl> 
  </head>
  <body> 

	<h1>Click here first</h1>

	<div id="test1"><span id="test2"><b>Click here</b></span></div>

  </body>
</html>
