<?xml version="1.0"?>
<bindings
          xmlns="http://www.mozilla.org/xbl"
          xmlns:xhtml="http://www.w3.org/1999/xhtml"
          >
  <binding id="semantic">
    <content>
      <xhtml:span bbid="children"><children /></xhtml:span>
	  <xhtml:span class="semantic-container">
	  	<xhtml:span bbid="content">
	    </xhtml:span>
	  	<xhtml:span class="semantic-items" bbid="semantic-items">
	    </xhtml:span>
	  </xhtml:span>
    </content>
    <resources>
      <stylesheet src="/public/divers/semantic.css"/>
    </resources>
    <implementation>
      <constructor>
          <![CDATA[
          var _attrs = this.attributes;
          var _def = document.getAnonymousElementByAttribute(this, "bbid", "semantic-items");
          document.getAnonymousElementByAttribute(this, "bbid", "children").style.display = "none";
          document.getAnonymousElementByAttribute(this, "bbid", "content").innerHTML = this.innerHTML;
          for (var i=0, _attr; _attr = _attrs[i]; i++)
          {
            if (_attr.name.substr(0, 5) == 'data-')
            {
              var _span = document.createElementNS("http://www.w3.org/1999/xhtml", "span");
              _span.setAttribute("class", "semantic-item");
               if (_attr.name.substr(0, 10) == 'data-link-')
               {
	             var _link = document.createElementNS("http://www.w3.org/1999/xhtml", "a");
	             _link.setAttribute("href", _attr.value);
                 _link.textContent = _attr.value;
                 _span.appendChild(document.createTextNode(_attr.name.substr(10) + ' : '));
                 _span.appendChild(_link);
               }
               else
               {
                 _span.textContent = _attr.name.substr(5) + ' : ' + _attr.value;
               }
              _def.appendChild(_span);
            }
          }
          ]]>
      </constructor>
    </implementation>
  </binding>
</bindings>