[XBL] Examples

Hi,

Below are comments regarding the examples in the XBL spec.


1. Introduction

I'd suggest using ".xml" as file extension here instead of ".xbl". Using 
".xbl" in examples might lead to mislabeled XBL on the Web.

   /* Reorder content */
   body { -xbl-binding: url(example.xbl#nav-then-main); }


1.1. Terminology and Conventions

"<[CDATA[" should be "<![CDATA[":

   <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
     <title>Demo</title>
     <xbl xmlns="http://www.w3.org/ns/xbl">
      <script><[CDATA[
       ...


2.2. The binding element

The ID "checkbox" is used twice:

   ...
    <binding element="ui|checkbox" id="checkbox"
             
extends="http://www.example.org/resources/ui-core.xml#valuedControl">
     <template>
      <div id="wrapper">
       <div id="checkbox"/>
        ...


2.5. The content element

"</ui>" should be "</data>":

   <data xmlns="http://example.com/data-language">
    ...
   </ui>


2.9. The div Element

The second "</handler>" should be "</handlers>":

   <xbl xmlns="http://www.w3.org/ns/xbl">
    <binding id="switch">
     ...
     <handlers>
      <handler event="click">
       this.shadowTree.getElementById('main').setAttribute('state',
         this.shadowTree.getElementById('main').getAttribute('state') == 
'on' ?
         'off' : 'on');
      </handler>
     </handler>
     ...


2.14. The prefetch element

Example uses "html" namespace prefix without a namespace declaration for the 
prefix. Also missing alt="":

   <xbl xmlns="http://www.w3.org/ns/xbl">
    <binding id="light">
     <template>
      <html:img id="l" src="red.png"/>
     ...


3.3. Loading Style Sheets

The <content/> element is in the XHTML namespace, should probably be in the 
XBL namespace:

   <xbl xmlns="http://www.w3.org/ns/xbl">
    <binding>
     <template>
      <div xmlns="http://www.w3.org/1999/xhtml">
       <content/>
      ...


4.2.1. Importing Binding Documents

In the examples, all occurances of "<binding>" should be "</binding>".


4.3. Attachment using CSS

The property should be "-xbl-binding" instead of "binding":

   input[type="checkbox"] {
     binding: url("http://www.example.org/xbl/htmlBindings.xml#checkbox");
   }


5.7.1. Selectors and Shadow Scopes

All occurances of "</p>" should be "</html:p>":

   <template>
    <html:p>...</p>
    <content includes="p"><html:p>...</p></content>
    <html:p>...</p>
   </template>


"<xbl:content>" should be "<xbl:content/>":

   <xbl:template>
     <A/>
     <xbl:content>
     <B/>
   </xbl:template>


5.9.1. General Rules

In the examples, usemap="test" should be usemap="#test".


Regards,
Simon Pieters

Received on Thursday, 14 September 2006 01:05:35 UTC