WD-sXBL-20050815 142 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html lang="en" xmlns="http://www.w3.org/1999/xhtml"><!--

   NOTES FOR EDITORS
   =================

     To convert this file to the sXBL.html file
     for publication, use the script found here:

       http://www.w3.org/Style/Group/css3-src/bin/postprocess

     Definitions are marked with <dfn>...</dfn>

     Proposed insertions and deletions are marked with:

         <div class="issue">...explanation...</div>
         <del cite="...uri...">...old text...</del>
         <ins cite="...uri...">...new text...</ins>

     ...where "uri" is the uri to the archives where the proposal was
     first made.

     Cross references are made with <span>...</span> where the
     contents match the contents of a <dfn> element, or <span
     title="...">...</span> where the title does.

     For more details see:

        http://www.w3.org/Style/Group/css3-src/css3-template/Overview.src.html

  -->

 <head>
  <title>SVG's XML Binding Language (sXBL)</title>

  <link href="default.css" rel="stylesheet" type="text/css" />

  <link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet"
   type="text/css" />
 </head>

 <body class="draft">
  <div class="head">
   <p> <a class="logo" href="http://www.w3.org/" rel="home"><img alt="W3C"
    height="48" src="http://www.w3.org/Icons/w3c_home" width="72" /></a></p>

   <h1 id="svgs-xml">SVG's XML Binding Language (sXBL)</h1>

   <h2 class="no-num no-toc" id="w3c-working">W3C Working Draft 15 August 2005</h2>

   <dl>
    <dt>This version:</dt>

    <dd><a
     href="http://www.w3.org/TR/2005/WD-sXBL-20050815">http://www.w3.org/TR/2005/WD-sXBL-20050815</a></dd>

    <dt>Latest version:</dt>

    <dd><a href="http://www.w3.org/TR/sXBL">http://www.w3.org/TR/sXBL</a></dd>

    <dt>Previous version:</dt>

    <dd><a
     href="http://www.w3.org/TR/2005/WD-sXBL-20050405/">http://www.w3.org/TR/2005/WD-sXBL-20050405/</a></dd>


    <dt>Editors:</dt>

    <dd>Jon Ferraiolo, Adobe Systems, <a
     href="mailto:jon.ferraiolo@adobe.com">jon.ferraiolo@adobe.com</a></dd>

    <dd>Ian Hickson, Opera Software, <a
     href="mailto:ian@hixie.ch">ian@hixie.ch</a></dd>

    <dd>David Hyatt, Apple, <a
     href="mailto:hyatt@apple.com">hyatt@apple.com</a></dd>
   </dl>
   <!--begin-copyright-->

   <p class="copyright"><a
    href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">
    Copyright</a> &copy; 2005 <a href="http://www.w3.org/"><abbr title="World
    Wide Web Consortium">W3C</abbr></a><sup>&reg;</sup> (<a
    href="http://www.csail.mit.edu/"><abbr title="Massachusetts Institute of
    Technology">MIT</abbr></a>, <a href="http://www.ercim.org/"><acronym
    title="European Research Consortium for Informatics and
    Mathematics">ERCIM</acronym></a>, <a
    href="http://www.keio.ac.jp/">Keio</a>), All Rights Reserved. W3C <a
    href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
    <a
    href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>

    and <a
    href="http://www.w3.org/Consortium/Legal/copyright-documents">document
    use</a> rules apply.</p>
   <!--end-copyright-->
   <hr />
  </div>

  <h2 class="no-num no-toc" id="abstract">Abstract</h2>

  <p>This working draft describes SVG's XML Binding Language (s<abbr
   title="XBL Binding Language">XBL</abbr>). sXBL is a mechanism for defining
   the presentation and interactive behavior of elements described in a
   namespace other than SVG's.</p>

  <p>sXBL is intended to be used to enable XML vocabularies (tag sets) to be
   implemented in terms of SVG elements. For instance, a tag set describing a
   flowchart could be mapped to low-level SVG path and text elements,
   possibly including interactivity and animation.</p>

  <p>sXBL is intended to be an SVG-specific first version of a more
   general-purpose XBL specification (e.g., "XBL 2.0"). The intent is that,
   in the future, a general-purpose and modularly-defined XBL specification
   will be developed which will replace this specification and will define
   additional features that are necessary to support scenarios beyond SVG,
   such as integration into web browsers that support CSS. Once a
   general-purpose XBL is defined, sXBL would just become an SVG-specific
   subset (i.e., a profile) of the larger XBL specification.</p>

  <h2 class="no-num" id="status">Status of this document</h2>

  <p><em>This section describes the status of this document at the time of
   its publication. Other documents may supersede this document. A list of
   current W3C publications and the latest revision of this technical report
   can be found in the <a href="http://www.w3.org/TR/">W3C technical reports
   index</a> at http://www.w3.org/TR/.</em></p>

  <p>This document is the fourth public working draft of the sXBL
   specification. This publication is especially intended to gather feedback
   on <a href="#includes-syntax">the syntax and performance of the
   <code>includes</code> attribute</a>.</p>

  <p>We explicitly invite comments on this specification and that issue in
   particular. Please send them to <a
   href="mailto:www-svg@w3.org">www-svg@w3.org</a>, the public e-mail list
   for issues related to vector graphics on the Web. This list is <a
   href="http://lists.w3.org/Archives/Public/www-svg/">archived</a> and
   acceptance of this archiving policy is requested automatically upon first
   post. To subscribe to this list send an email to <a
   href="mailto:www-svg-request@w3.org">www-svg-request@w3.org</a> with the
   word subscribe in the subject line.</p>

  <p>The feature set in sXBL represents a repackaging and generalization of
   the <em>Rendering Custom Content</em> (RCC) feature which had been
   described in previous SVG 1.2 specifications (see <a
   href="http://www.w3.org/TR/2004/WD-SVG12-20040510/#rcc">RCC</a>). With
   this public draft, the features that were formerly in RCC have been
   factored out into a separate specification, reformulated for more general
   applicability for possible future use with other markup languages and
   moved into an XBL-specific namespace. The refactoring of RCC into sXBL was
   partly the result of coordination efforts within the W3C across working
   groups (particularly the SVG and CSS working groups) to ensure that
   RCC/sXBL was forward-looking and could develop into a future
   modularly-defined and general-purpose XBL specification which met the
   needs of multiple XML markup languages, not just SVG.</p>

  <p>As a result of the reformulation, nearly every element from RCC has been
   renamed. Although there have been major changes in syntax, the resulting
   sXBL feature set performs the same operations and satisfies the same
   requirements as RCC. Sometimes it is possible to migrate RCC-based widget
   definitions to XBL-based widget definitions after some global search and
   replace string substitutions.</p>

  <p>This document has been produced by the sXBL subgroup of the <a
   href="http://www.w3.org/Graphics/SVG/">W3C SVG Working Group</a> as part
   of the W3C <a href="http://www.w3.org/Graphics/Activity">Graphics
   Activity</a>, within the <a
   href="http://www.w3.org/Interaction/">Interaction Domain</a>.</p>

  <p>The XBL task force considers the sXBL specification nearly ready for
   Last Call. After evaluating public feedback on this draft, the next
   public draft might be a Last Call working draft.</p>

  <p>The patent policy for this document is the <a
   href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
   2004 W3C Patent Policy</a>. Patent disclosures relevant to this
   specification may be found on the <a
   href="http://www.w3.org/Graphics/SVG/Disclosures" rel="disclosure">SVG
   Working Group's patent disclosure page</a>. An individual who has actual
   knowledge of a patent which the individual believes contains Essential
   Claim(s) with respect to this specification should disclose the
   information in accordance with <a
   href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
   6 of the W3C Patent Policy</a>.</p>

  <p>Publication as a Working Draft does not imply endorsement by the W3C
   Membership. This is a draft document and may be updated, replaced or
   obsoleted by other documents at any time. It is inappropriate to cite this
   document as other than work in progress.</p>

  <h2 class="no-num no-toc" id="table">Table of contents</h2>

  <!--begin-toc-->

  <ul class="toc">
   <li class="no-num"><a href="#status">Status of this document</a></li>

   <li><a href="#introduction"><span class="secno">1. </span>Introduction</a>
    
    <ul class="toc">
     <li><a href="#history"><span class="secno">1.1. </span>History</a></li>

     <li><a href="#terminology"><span class="secno">1.2. </span>Terminology
      and Conventions</a></li>

     <li><a href="#conformance"><span class="secno">1.3.
      </span>Conformance</a></li>

     <li><a href="#loading"><span class="secno">1.4. </span><dfn
      id="loading0">Loading External Resources</dfn></a></li>
    </ul>

   </li>

   <li><a href="#xbl-elements"><span class="secno">2. </span>XBL Elements</a>
    
    <ul class="toc">
     <li><a href="#the-xbl"><span class="secno">2.1. </span>The <dfn
      id="xbl">xbl</dfn> Element</a></li>

     <li><a href="#the-definition"><span class="secno">2.2. </span>The <dfn
      id="definition">definition</dfn> Element</a></li>

     <li><a href="#the-template"><span class="secno">2.3. </span>The <dfn
      id="template">template</dfn> Element</a></li>

     <li><a href="#the-content"><span class="secno">2.4. </span>The <dfn
      id="content">content</dfn> Element</a></li>

     <li><a href="#the-handlergroup"><span class="secno">2.5. </span>The <dfn
      id="handlergroup">handlerGroup</dfn> Element</a></li>

     <li><a href="#the-import"><span class="secno">2.6. </span>The <dfn
      id="import">import</dfn> Element</a></li>

     <li><a href="#the-id"><span class="secno">2.7. </span>The <dfn id="id"
      title="attr-id">id</dfn> attribute of XBL elements</a></li>
    </ul>
   </li>

   <li><a href="#binding"><span class="secno">3. </span><dfn
    id="binding3">Binding Attachment and Detachment</dfn></a>
    <ul class="toc">

     <li><a href="#interpretation"><span class="secno">3.1. </span><dfn
      id="interpretation0">Interpretation of URIs to XBL bindings</dfn></a></li>

     <li><a href="#attachment"><span class="secno">3.2. </span><dfn
      id="attachment0" title="attachment using bind">Attachment using
      <code>definition</code></dfn></a></li>

     <li><a href="#binding0"><span class="secno">3.3. </span><dfn
      id="binding4">Binding Attachment Model</dfn></a></li>

     <li><a href="#binding1"><span class="secno">3.4. </span>Binding
      Detachment Model</a></li>

     <li><a href="#summary"><span class="secno">3.5. </span>Summary of
      Events</a></li>

     <li><a href="#script"><span class="secno">3.6. </span><dfn
      id="script0">Script contexts</dfn></a></li>
    </ul>
   </li>

   <li><a href="#shadow"><span class="secno">4. </span><dfn
    id="shadow2">Shadow Content</dfn></a>

    <ul class="toc">
     <li><a href="#rules"><span class="secno">4.1. </span><dfn
      id="rules0">Rules for Shadow Content Generation</dfn></a></li>

     <li><a href="#processing"><span class="secno">4.2. </span><dfn
      id="processing0">Processing <code>content</code> elements</dfn></a></li>

     <li><a href="#handling"><span class="secno">4.3. </span>Handling DOM
      Changes</a></li>

     <li><a href="#shadow0"><span class="secno">4.4. </span>Shadow Content
      and CSS</a>
      <ul class="toc">
       <li><a href="#terminology0"><span class="secno">4.4.1.
        </span>Terminology</a></li>

       <li><a href="#selectors"><span class="secno">4.4.2. </span><dfn
        id="selectors0">Selectors and Shadow Scopes</dfn></a></li>
      </ul>

     </li>

     <li><a href="#shadow1"><span class="secno">4.5. </span>Shadow Content
      and <code>xml:base</code></a></li>

     <li><a href="#binding2"><span class="secno">4.6. </span><dfn
      id="binding5">Binding Stylesheets</dfn></a></li>
    </ul>
   </li>

   <li><a href="#event"><span class="secno">5. </span><dfn id="event2">Event
    Handlers</dfn></a>
    <ul class="toc">
     <li><a href="#event0"><span class="secno">5.1. </span><dfn
      id="event3">Event forwarding</dfn></a></li>

     <li><a href="#event1"><span class="secno">5.2. </span><dfn
      id="event4">Event Flow and Targeting Across Shadow Scopes</dfn></a></li>

     <li><a href="#focus"><span class="secno">5.3. </span>Focus, DOMFocusIn,
      Blur, and DOMFocusOut Events</a></li>

     <li><a href="#mouseover"><span class="secno">5.4. </span>Mouseover and
      Mouseout Events</a></li>
    </ul>
   </li>

   <li><a href="#dom-interfaces"><span class="secno">6. </span><dfn
    id="dom-interfaces0">DOM Interfaces</dfn></a>

    <ul class="toc">
     <li><a href="#the-nodexbl"><span class="secno">6.1. </span>The <dfn
      id="nodexbl">NodeXBL</dfn> Interface</a>
      <ul class="toc">
       <li><a href="#scoping"><span class="secno">6.1.1. </span>Scoping and
        Access Using the DOM</a></li>

       <li><a href="#dom-traversals"><span class="secno">6.1.2. </span><dfn
        id="dom-traversals0">DOM Traversals in the Presence of XBL</dfn></a></li>

       <li><a href="#example"><span class="secno">6.1.3. </span>Example of
        XBL DOM Traversals</a></li>
      </ul>
     </li>

     <li><a href="#the-event"><span class="secno">6.2. </span>The
      <code>Event</code> Interface</a></li>

     <li><a href="#the-xblshadowtreeelement"><span class="secno">6.3.
      </span>The <dfn id="xblshadowtreeelement">XBLShadowTreeElement</dfn>
      Interface</a></li>
    </ul>
   </li>

   <li><a href="#Examples"><span class="secno">7. </span>Examples</a></li>

   <li><a href="#grammar"><span class="secno">8. </span>Grammar</a></li>

   <li><a href="#RCCComparison"><span class="secno">9. </span>Comparison of
    sXBL to RCC</a></li>

   <li><a href="#XBLComparison"><span class="secno">10. </span> Comparison of
    sXBL to XBL1</a></li>

   <li class="no-num"><a href="#acknowledgments">Acknowledgments</a></li>

   <li class="no-num"><a href="#references">References</a></li>
  </ul>
  <!--end-toc-->

  <hr />

  <h2 id="introduction"><span class="secno">1. </span>Introduction</h2>

  <p>This specification defines SVG's XML Binding Language (or XBL for short)
   and some supporting DOM interfaces. sXBL is a mechanism for defining the
   presentation and interactive behavior of particular elements described in
   a namespace other than SVG's with a "binding". Bindings can be attached to
   elements by declaring, in XBL, that a particular element in a particular
   namespace is implemented by a particular binding. The element that the
   binding is attached to, called the bound element, acquires the new
   behavior and presentation specified by the binding.</p>

  <p>XBL is currently defined as a set of new elements that can be used in
   SVG document fragments and SVG resources. A future version may extend XBL
   to be applicable to any markup, and the current version has been designed
   with this goal in mind.</p>

  <p>XBL cannot be used to give a document new semantics (except if script
   invoked by XBL explicitly changes the original DOM). The meaning of a
   document is not changed by any bindings that are associated with it, only
   its presentation and interactive behavior.</p>

  <div class="example">
   <p>The following is a simple SVG example where a custom element
    (<code>&lt;myNS:HelloWorld/&gt;</code>) acquires the alternate
    presentation behavior defined by the &lt;xbl:definition&gt; element at
    the top of the file. The <code>&lt;myNS:HelloWorld/&gt;</code> element
    will be rendered by using the contents of the shadow tree which is
    attached by the binding. The shadow tree consists of an
    <code>&lt;svg:text&gt;</code> element which has the string "Hello, world,
    using sXBL" inside:</p>

   <pre>&lt;?xml version="1.0"?&gt;
&lt;svg width="10cm" height="3cm" viewBox="0 0 200 60"
     xmlns="http://www.w3.org/2000/svg" version="1.2"
     xmlns:xbl="http://www.w3.org/2004/xbl"
     xmsns:myNS="http://www.example.com"&gt;
  &lt;title&gt;Example xbl01.svg - "hello world" sample file&lt;/title&gt;
  &lt;desc&gt;A simple "Hello, world" sXBL example where the
         rendering behavior of a custom element 'myNS:HelloWorld'
         consists of an 'svg:text' element which has the string 
         "Hello, world, using sXBL" inside.&lt;/desc&gt;
  &lt;defs&gt;

    <strong>&lt;xbl:xbl&gt;

      &lt;!-- The following 'xbl:definition' element defines the
         presentation and interactive behavior that must be used
         for all 'myNS:HelloWorld' elements in this document. --&gt;
      &lt;xbl:definition element="myNS:HelloWorld&gt;
        &lt;xbl:template&gt;
          &lt;text&gt;Hello, world, using sXBL&lt;/text&gt;

        &lt;/xbl:template&gt;
      &lt;/xbl:definition&gt;

    &lt;/xbl:xbl&gt;</strong>
  &lt;/defs&gt;

  &lt;rect x="1" y="1" width="198" height="58" fill="none" stroke="blue"/&gt;

  &lt;g font-size="14" font-family="Verdana" transform="translate(10,35)"&gt;

    <strong>&lt;!-- Here is an instance of an 'myNS:HelloWorld' element.
       The above binding definition attaches a shadow tree which
       defines alternative rendering and interactive behavior for this element.
       Instead of the standard SVG behavior where unknown elements are not rendered,
       the binding definition causes an 'svg:text' element to be rendered. --&gt;
    &lt;myNS:HelloWorld/&gt;</strong>

  &lt;/g&gt;

&lt;/svg&gt;</pre>

   <p>The above example results in equivalent rendering to the following SVG.
    The highlighted sections below (i.e., the <code>&lt;g&gt;</code> and
    <code>&lt;text&gt;</code> elements) represent the shadow tree which the
    binding definition (i.e., the <code>&lt;xbl:definition&gt;</code> element
    defined above) attaches to the custom element. The SVG user agent renders
    the shadow tree in place of the custom element.</p>

   <pre>  &lt;svg width="10cm" height="3cm" viewBox="0 0 200 60"
       xmlns="http://www.w3.org/2000/svg" version="1.2"&gt;

    &lt;title&gt;Example xbl01-equivalent.svg - 
           equivalent rendering for "hello world" sample file&lt;/title&gt;

    &lt;rect x="1" y="1" width="198" height="58" fill="none" stroke="blue"/&gt;
    &lt;g font-size="14" font-family="Verdana" transform="translate(10,35)"&gt;

      <strong>&lt;!-- The document is rendered as if the 'myNS:HelloWorld' element 
           were replaced by an SVG 'g' element with a 'text' element inside. --&gt;
      &lt;g&gt;

        &lt;text&gt;Hello, world, using sXBL&lt;/text&gt;
      &lt;/g&gt;</strong>

    &lt;/g&gt;

  &lt;/svg&gt;</pre>

   <p> <img alt="The result is as if the 'g' element simply contained the
    text directly." src="images/examples/xbl01.png" /></p>

   <p><a href="images/examples/xbl01.svg">View this image as SVG
    (SVG/sXBL-enabled browsers only)</a></p>
  </div>

  <p>Other examples can be found in the <a href="#Examples">Examples</a>
   section.</p>

  <h3 id="history"><span class="secno">1.1. </span>History</h3>

  <p>This specification is the culmination of several years of work by
   several groups.</p>

  <dl>
   <dt><a href="http://www.w3.org/TR/NOTE-AS">Action Sheets A Modular Way of
    Defining Behavior for XML and HTML</a> (AS)</dt>

   <dd>Vidur Apparao, Brendan Eich, Ramanathan Guha, Nisheeth Ranjan;
    Netscape Communications Corp. W3C Member Submission, June 1998.</dd>

   <dt><a href="http://www.w3.org/TR/1998/NOTE-HTMLComponents-19981023">HTML
    Components - Componentizing Web Applications</a> (HTCs)</dt>

   <dd>Chris Wilson; Microsoft. W3C Member Submission, October 1998.</dd>

   <dt><a href="http://www.w3.org/TR/1999/WD-becss-19990804">Behavioral
    Extensions to CSS</a> (BECSS)</dt>

   <dd>Vidur Apparao, Daniel Glazman, Chris Wilson; CSS Working Group. W3C
    Working Draft, August 1999.</dd>

   <dt><a href="http://www.w3.org/TR/2001/NOTE-xbl-20010223/">XBL - XML
    Binding Language</a> (XBL)</dt>

   <dd>David Hyatt; mozilla.org. W3C Member Submission, January 2001.</dd>

   <dt><a href="http://www.w3.org/TR/2004/WD-SVG12-20040318/#rcc">Rendering
    Custom Content</a> (RCC; part of some SVG 1.2 drafts)</dt>

   <dd>Dean Jackson; SVG Working Group. W3C Working Draft, March 2004.</dd>
  </dl>

  <h3 id="terminology"><span class="secno">1.2. </span>Terminology and
   Conventions</h3>

  <p>A <dfn id="binding6" title="a binding">binding</dfn> is the definition
   of behavior that can be applied to an element so as to define its
   presentation.</p>

  <p>An <dfn id="xbl-subtree">XBL subtree</dfn> is a subtree in an SVG
   document fragment, the subtree having as its root
   <!-- XXX better word than root? --> node an <code><a
   href="#xbl0">xbl</a></code> element in the XBL namespace, which is used to
   define bindings.</p>

  <p>The term <dfn id="binding7">binding document</dfn> is used to mean a
   document containing an SVG fragment that itself contains <span title="XBL
   subtree"><a href="#xbl-subtree">XBL subtrees</a></span>.</p>

  <p>A <dfn id="bound">bound element</dfn> is an element in an arbitrary XML
   namespace, to which a binding has been applied.</p>

  <p>A <dfn id="bound0">bound document</dfn> is a document containing an SVG
   fragment with one or more bound elements.</p>

  <p>The <dfn id="shadow3">shadow tree</dfn> for a bound element is the
   subtree of nodes that are attached to a bound element as a result of XBL
   processing. (See: <span><a href="#shadow6">shadow content</a></span>.) The
   contents of the shadow tree augment the bound element's standard
   presentation and interactive behavior with alternate behavior. The shadow
   tree is hidden from normal DOM processing (hence the name "shadow"). The
   shadow tree is attached to the bound element. Once attached, the shadow
   tree can be accessed only via XBL-specific DOM extensions and therefore is
   not accessible via Core DOM navigation facilities such as <code
   class="dom">firstChild</code> or <code class="dom">nextSibling</code>.
   (See: <span><a href="#dom-interfaces1">DOM interfaces</a></span>.)</p>

  <p>The term <dfn id="shadow4">shadow content</dfn> refers to the various
   nodes in the shadow tree of a bound element. Shadow content is created by
   cloning a <span><a href="#shadow5">shadow content template</a></span>
   during binding attachment. (See: <span><a href="#shadow6">shadow
   content</a></span>.)</p>

  <p>In this specification, the term <dfn id="in-error">in error</dfn>, when
   used of an element or attribute, means that the element or attribute is
   not conformant according to the rules of this specification.</p>

  <p class="issue">JF has a <a
   href="http://www.w3.org/2005/05/09-svg-irc#T16-17-14">pending action
   item</a> (member only) to propose text for this section that defines the
   conformance criteria for when a UA hits an error condition.</p>

  <p>A <dfn id="correct" title="correct">correct element or attribute</dfn>
   is one which is not <span><a href="#in-error">in error</a></span>.</p>

  <p>The namespace of all the <dfn id="xbl-elements0">XBL elements</dfn> must
   be: <code class="uri">http://www.w3.org/2004/xbl</code></p>

  <p>XBL elements are frequently referred to by just their local name in this
   specification. In real documents, they must be associated with the XBL
   namespace as per the rules given in the Namespaces in XML specification <a
   href="#refsXMLNS">[XMLNS]</a>.</p>

  <p>For convenience, elements and attributes from specific namespaces are
   sometimes referred to simply in the form <code>prefix:localname</code>,
   without explicitly stating which namespace the prefix is bound to. When
   this occurs, readers should assume the following prefix declarations are
   in scope:</p>

  <pre><!--xmlns="http://www.w3.org/2004/xbl"
-->xmlns:xbl="http://www.w3.org/2004/xbl"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"</pre>

  <p>All element names, attribute names, and attribute values in XBL are case
   sensitive.</p>

  <h3 id="conformance"><span class="secno">1.3. </span>Conformance</h3>

  <p>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in <a
   href="#refsRFC2119">[RFC2119]</a>. For readability, these words are not
   capitalised in this specification.</p>

  <p>All sections of this specification including the introduction and the
   schema snippets are normative unless they explicitly state otherwise.
   Errata are also normative but override conflicting parts of the
   specification.</p>

  <h3 id="loading"><span class="secno">1.4. </span><dfn id="loading1">Loading
   External Resources</dfn></h3>

  <p class="issue"> JF has a pending action item to propose text for this
   section (<a
   href="http://lists.w3.org/Archives/Member/member-binding-tf/2004OctDec/0025.html">minutes</a>,
   member only) to point to <a
   href="http://www.w3.org/TR/2004/WD-SVG12-20041027/nonvisual.html#external-references">17.1
   Externally referenced documents</a>.</p>
 
  <p>Several features in XBL allow external resources to be loaded.</p>

  <p>When the specification says that the resource must be loaded <em>unless
   it has already been loaded</em>, then references to the same resource
   (even if they are somewhat indirect, for example via HTTP redirects) must
   result in the same instance being reused, or shared. To determine if two
   resources are the same, their final base URIs (after all redirects) are
   compared.</p>

  <div class="example">
   <p>Assume RX is a resource that redirects to resource X using the HTTP 301
    redirection mechanism. A document contains an <code><a
    href="#import0">import</a></code> element that refers to binding document
    X. A new DOM <code>Document</code> instance is created to represent that
    instance and the relevant bindings are used. The binding document (X)
    itself then refers to resource RX. While that resource was being loaded,
    the redirect to X would be discovered, and therefore instead of creating
    a new <code>Document</code>, the existing one would be reused.</p>

  </div>

  <p>Such resource sharing is limited to resources loaded by a document, and
   the resources loaded by already-loaded-shared-resources for that document.
   <span class="issue">Can we phrase that better? The idea is that two
   IFRAMEs whose documents use the same resource should NOT share that
   resource.</span> <span class="issue">We may also want to be explicit than
   resources that are currently loading count as resources that are already
   loaded...</span></p>

  <p>Several XBL attributes are defined to contain URIs. All URIs may be
   relative. For relative URIs, the rules given in <a
   href="#refsXMLBASE">[XMLBASE]</a> must be used to resolve the value to an
   absolute URI.</p>

  <h2 id="xbl-elements"><span class="secno">2. </span>XBL Elements</h2>

  <p>The start of any XBL subtree is an <code><a href="#xbl0">xbl</a></code>
   element, which is described below.</p>

  <p>When an XBL subtree does not conform to the descriptions given below in
   the "Expected context" and "Expected children" sections, the document is
   <span><a href="#in-error">in error</a></span>.</p>

  <h3 id="the-xbl"><span class="secno">2.1. </span>The <dfn
   id="xbl0">xbl</dfn> Element</h3>

  <dl>
   <dt>RelaxNG language definition:</dt>

   <dd>

    <pre class="schema">&lt;element name='xbl'&gt;
  &lt;zeroOrMore&gt;&lt;ref name='definition'/&gt;&lt;/zeroOrMore&gt;
  &lt;zeroOrMore&gt;&lt;ref name='import'/&gt;&lt;/zeroOrMore&gt;
  &lt;ref name='id.attrib'/&gt;
&lt;/element&gt;</pre>

   </dd>

   <dt>Expected children (in any order):</dt>

   <dd><code><a href="#definition0">definition</a></code>: zero or more.</dd>

   <dd><code><a href="#import0">import</a></code>: zero or more.</dd>

   <dd>Any non-XBL element.</dd>
  </dl>

  <p>The <code><a href="#xbl0">xbl</a></code> element is the root element of
   all XBL subtrees.</p>

  <div class="example">
   <p>The following example shows an SVG example with an <code><a
    href="#xbl0">xbl</a></code> element which contains two binding
    definitions. It also shows an example of an <code>svg:defs</code>

    element.</p>

   <pre>
&lt;svg:svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2"&gt;
 &lt;xbl xmlns="http://www.w3.org/2004/xbl"&gt;
  &lt;svg:defs&gt;
      &lt;!-- possible definitions of SVG gradients, filters, etc.
           that might be referenced from the binding definitions. -- &gt;

  &lt;/svg:defs&gt;
  &lt;definition id="binding1" element="example"&gt;
    ...
  &lt;/definition&gt;
  &lt;definition id="binding2"&gt;
    ...
  &lt;/definition&gt;

 &lt;/xbl&gt;
&lt;/svg:svg&gt;
</pre>
  </div>

  <h4 class="no-toc no-num" id="attributes">Attributes</h4>

  <dl>
   <dt><dfn id="id0" title="attr-xbl-id">id</dfn></dt>

   <dd>The <span title="attr-id"><a href="#id6"><code>id</code>
    attribute</a></span>.</dd>
  </dl>

  <p>UAs must consider any <code><a href="#xbl0">xbl</a></code> elements that
   have another <code><a href="#xbl0">xbl</a></code> element as an ancestor
   as being <span><a href="#in-error">in error</a></span> and must then
   <span>ignore</span> them, meaning those elements must never be considered
   to declare any bindings. For example, UAs must never bind elements to
   bindings defined by <code><a href="#definition0">definition</a></code>

   elements that have two <code><a href="#xbl0">xbl</a></code> ancestors.</p>

  <h3 id="the-definition"><span class="secno">2.2. </span>The <dfn
   id="definition0">definition</dfn> Element</h3>

  <dl>

   <dt>RelaxNG language definition:</dt>

   <dd>
    <pre class="schema">&lt;element name='definition'&gt;
  &lt;choice&gt;
    &lt;attribute name='ref'&gt;&lt;data type='anyURI'/&gt;&lt;/attribute&gt;

    &lt;group&gt;
      &lt;optional&gt;&lt;ref name='template'/&gt;&lt;/optional&gt;
      &lt;optional&gt;&lt;ref name='handlerGroup'/&gt;&lt;/optional&gt;
      &lt;attribute name='element'&gt;&lt;data type='QName'/&gt;&lt;/attribute&gt;

    &lt;/group&gt;
  &lt;/choice&gt;
  &lt;ref name='id.attrib'/&gt;
&lt;/element&gt;</pre>
   </dd>

   <dt>Expected context:</dt>

   <dd><code><a href="#xbl0">xbl</a></code></dd>

   <dt>Expected children (in any order), if the <code
    title="attr-definition-ref"><a href="#ref">ref</a></code> attribute is
    not specified:</dt>

   <dd><code><a href="#template0">template</a></code>: zero or one.</dd>

   <dd><code><a href="#handlergroup0">handlerGroup</a></code>: zero or one.</dd>

   <dd>Any non-XBL element</dd>

   <dt>Expected children (in any order), if the <code
    title="attr-definition-ref"><a href="#ref">ref</a></code> attribute
    <em>is</em> specified:</dt>

   <dd>None.</dd>
  </dl>

  <p>The <code><a href="#definition0">definition</a></code> element describes
   a single XBL binding that adds presentation and interactive behavior to
   non-SVG elements. Each binding has these optional components:</p>

  <p><em><a href="#template0">Template</a></em>: The optional <code><a
   href="#template0">template</a></code> defines the initial <em><a
   href="#shadow6">shadow content</a></em> for the bound element.</p>

  <p><em title="handlerGroup"><a href="#handlergroup0">Behavior</a></em>: A
   binding can define event listeners for various types of events. Some
   examples are: UI events (e.g., key and mouse events) on the bound element
   or on elements within the shadow content; mutation events on the bound
   element and its descendants; and events having to do with XBL's binding
   operations (e.g., the <code class="dom"><a
   href="#prebind">prebind</a></code> and <code class="dom"><a
   href="#bound1">bound</a></code> events). (See: <span><a
   href="#event5">event handlers</a></span>.)</p>

  <p>Alternatively, a binding may reference an existing binding, with the
   <code title="attr-definition-ref"><a href="#ref">ref</a></code> attribute.
   In this case, the <code title="attr-definition-ref"><a
   href="#ref">ref</a></code> attribute must reference a <code><a
   href="#definition0">definition</a></code> element which in turn supplies
   the binding definition.</p>

  <p>Bindings may also act as an attachment mechanism, specifying a namespace
   and local name of elements to associate with the given binding when the
   binding is <span title="importing">imported</span>, using the <code
   title="attr-definition-element"><a href="#element">element</a></code>
   attribute.</p>

  <p>In addition to the above, the <code><a
   href="#definition0">definition</a></code> element may contain any element
   outside the XBL namespace, for example <code>svg:defs</code>. These are
   handled as they would be in any other context, and are ignored by the XBL
   processing model.</p>

  <h4 class="no-toc no-num" id="attributes0">Attributes</h4>

  <dl>
   <dt><dfn id="id1" title="attr-definition-id">id</dfn></dt>

   <dd>The <span title="attr-id"><a href="#id6"><code>id</code>
    attribute</a></span>.</dd>

   <dt><dfn id="ref" title="attr-definition-ref">ref</dfn></dt>

   <dd>
    <p>This attribute specifies a URI to use to find the binding instead of
     looking inside the <code><a href="#definition0">definition</a></code>
     element itself. (See: <span><a href="#interpretation1">interpretation of
     URIs to XBL bindings</a></span>.)</p>

    <p>When a <code><a href="#definition0">definition</a></code> element has
     a <code title="attr-definition-ref"><a href="#ref">ref</a></code>
     attribute, the UA must fetch the specified resource (unless it has <span
     title="loading external resources"><a href="#loading1">already been
     loaded</a></span>).</p>

    <p>If the URI references a <code><a
     href="#definition0">definition</a></code> element, and that element does
     not have a <code title="attr-definition-ref"><a
     href="#ref">ref</a></code> attribute, then for the purposes of the rest
     of the XBL processing model, the element with the <code
     title="attr-definition-ref"><a href="#ref">ref</a></code> attribute is
     treated as if it had the children nodes of the element to which it
     refers.</p>

    <p>If the URI does not reference a <code><a
     href="#definition0">definition</a></code> element, it is <span><a
     href="#in-error">in error</a></span>.</p>

    <p>The referenced <code><a href="#definition0">definition</a></code>
     element cannot have a <code title="attr-definition-ref"><a
     href="#ref">ref</a></code> attribute (i.e., only one level of
     indirection is allowed); otherwise, the original <code><a
     href="#definition0">definition</a></code> element is <span><a
     href="#in-error">in error</a></span>.</p>

   </dd>

   <dt><dfn id="element" title="attr-definition-element">element</dfn></dt>

   <dd>This attribute specifies the qualified name (QName) of an element to
    attach to the binding when the binding is <span
    title="importing">imported</span>.
    <p>If an <code title="attr-definition-element"><a
     href="#element">element</a></code> attribute does not resolve to a valid
     qualified name (QName) using the attribute QName resolving semantics and
     the namespace prefix declarations in scope on the element, it is
     <span><a href="#in-error">in error</a></span>. <a
     href="#refsXMLNS">[XMLNS]</a></p>

   </dd>
  </dl>

  <p>If a <code><a href="#definition0">definition</a></code> element contains
   both a <code title="attr-definition-ref"><a href="#ref">ref</a></code>
   attribute and has child nodes other than comment nodes or whitespace text
   nodes, then it is <span><a href="#in-error">in error</a></span>.</p>

  <div class="issue">The task force believes that a sentence equivalent to
   the following note needs to be somewhere in the spec, so that people don't
   think XBL can be used as a justification for sending markup over the wire
   without verifying that the sender and consumer both agree on the meaning
   of the markup. It was generally agreed that the word "semantics" might be
   better avoided while expressing this concept, however, and so this text is
   not yet final.</div>

  <p class="note">The <code><a href="#definition0">definition</a></code>
   element defines a presentation and behavior binding. It does not define an
   element's semantics. If an element has no semantics when processed alone,
   then it has no semantics when processed with XBL.</p>

  <h3 id="the-template"><span class="secno">2.3. </span>The <dfn
   id="template0">template</dfn> Element</h3>

  <dl>
   <dt>RelaxNG language definition:</dt>

   <dd>
    <pre class="schema">&lt;element name='template'&gt;
  &lt;ref name='id.attrib'/&gt;
&lt;/element&gt;</pre>

   </dd>

   <dt>Expected context:</dt>

   <dd><code><a href="#definition0">definition</a></code></dd>

   <dt>Expected children:</dt>

   <dd>Anything. Of particular interest, the <code><a
    href="#content0">content</a></code> element may occur as descendants.</dd>

  </dl>

  <p>The <code><a href="#template0">template</a></code> element contains
   child nodes that can be in any namespace. The subtree specified by the
   <code><a href="#template0">template</a></code> element is referred to as
   the <dfn id="shadow5">shadow content template</dfn>. When a binding is
   attached, the <code><a href="#template0">template</a></code> element's
   child nodes are cloned and attached to the bound document under the bound
   element (where they are accessible via the <code class="dom"><a
   href="#xblshadowtree">xblShadowTree</a></code> DOM property). Because
   these cloned nodes are hidden from their parent and exist outside the
   normal document tree, they are referred to as <span><a
   href="#shadow6">shadow content</a></span>.</p>

  <p>When the <code><a href="#template0">template</a></code> element is
   cloned, it is renamed to <code><a
   href="#shadowtree">shadowTree</a></code>. (See: <span><a
   href="#rules1">rules for shadow content generation</a></span>.)</p>

  <h4 class="no-toc no-num" id="attributes1">Attributes</h4>

  <dl>

   <dt><dfn id="id2" title="attr-template-id">id</dfn></dt>

   <dd>The <span title="attr-id"><a href="#id6"><code>id</code>
    attribute</a></span>.</dd>
  </dl>

  <h3 id="the-content"><span class="secno">2.4. </span>The <dfn
   id="content0">content</dfn> Element</h3>

  <dl>
   <dt>RelaxNG language definition:</dt>

   <dd>
    <pre class="schema">&lt;element name='content'&gt;
  &lt;optional&gt;&lt;attribute name='includes'&gt;&lt;text/&gt;&lt;/attribute&gt;&lt;/optional&gt;

  &lt;ref name='id.attrib'/&gt;
&lt;/element&gt;</pre>
   </dd>

   <dt>Expected context:</dt>

   <dd>Any, but there must be a correct <code><a
    href="#template0">template</a></code> element somewhere in the ancestor
    chain, and there must not be any correct <code><a
    href="#content0">content</a></code> elements anywhere in the ancestor
    chain.</dd>

   <dt>Expected children:</dt>

   <dd>Anything.</dd>
  </dl>

  <p>The <code><a href="#content0">content</a></code> element is used inside
   <span><a href="#shadow6">shadow content</a></span> to specify insertion
   points for explicit content that might already exist underneath the bound
   element. As far as the presentation model is concerned, any shadow content
   the binding places between the bound element and the <code><a
   href="#content0">content</a></code> elements is interleaved between the
   bound element and its explicit children without affecting the document
   model. (See: <span><a href="#processing1">processing <code
   title="">content</code> elements</a></span>.)</p>

  <p>If the <code>includes</code> attribute successfully matches against
   children of the bound element, then those children are inserted into the
   <span><a href="#final">final flattened tree</a></span> in place of the
   <code><a href="#content0">content</a></code> element. If the
   <code>includes</code> attribute does not match against any children, then
   the child elements of the <code><a href="#content0">content</a></code>

   element are inserted into the <span><a href="#final">final flattened
   tree</a></span> in place of the <code><a
   href="#content0">content</a></code> element instead.</p>

  <h4 class="no-toc no-num" id="attributes2">Attributes</h4>

  <dl>
   <dt><dfn id="id3" title="attr-content-id">id</dfn></dt>

   <dd>The <span title="attr-id"><a href="#id6"><code>id</code>
    attribute</a></span>.</dd>

   <dt><dfn id="includes" title="attr-content-includes">includes</dfn></dt>

   <dd>The <code title="attr-content-includes"><a
    href="#includes">includes</a></code> attribute can be used to indicate
    that only certain content should be placed at the <code><a
    href="#content0">content</a></code> element. Its value is a local name
    (with no namespace). (See: <span><a href="#processing1">processing <code
    title="">content</code> elements</a></span>.)</dd>

  </dl>

  <h3 id="the-handlergroup"><span class="secno">2.5. </span>The <dfn
   id="handlergroup0">handlerGroup</dfn> Element</h3>

  <dl>
   <dt>RelaxNG language definition:</dt>

   <dd>
    <pre class="schema">&lt;element name='handlerGroup'&gt;

  &lt;!-- the content model for this element mentions ev:listener and svg:handler
       but is rather unclear as to what should be included here --&gt;

  &lt;ref name='id.attrib'/&gt;
&lt;/element&gt;</pre>
   </dd>

   <dt>Expected context:</dt>

   <dd><code><a href="#definition0">definition</a></code></dd>

   <dt>Expected children:</dt>

   <dd>Any event listening element, in particular <code>ev:listener</code>

    and <code>svg:handler</code>.</dd>
  </dl>

  <p>The <code><a href="#handlergroup0">handlerGroup</a></code> element's
   event handlers can be called for events that flow through the bound
   element. During capture, target and bubbling phases, when a given event is
   received by a bound element, if a corresponding event listener has been
   attached to the <code><a href="#handlergroup0">handlerGroup</a></code>
   element, then the event will be <span title="event forwarding"><a
   href="#event6">forwarded</a></span> to that event listener. (See: <span><a
   href="#event6">event forwarding</a></span>, <span><a
   href="#binding8">binding attachment and detachment</a></span>.)</p>

  <h4 class="no-toc no-num" id="attributes3">Attributes</h4>

  <dl>
   <dt><dfn id="id4" title="attr-handlerGroup-id">id</dfn></dt>

   <dd>The <span title="attr-id"><a href="#id6"><code>id</code>
    attribute</a></span>.</dd>

  </dl>

  <h3 id="the-import"><span class="secno">2.6. </span>The <dfn
   id="import0">import</dfn> Element</h3>

  <dl>
   <dt>RelaxNG language definition:</dt>

   <dd>
    <pre class="schema">&lt;element name='import'&gt;
  &lt;optional&gt;&lt;attribute name='bindings'&gt;&lt;data type='anyURI'/&gt;&lt;/attribute&gt;&lt;/optional&gt;
  &lt;ref name='id.attrib'/&gt;
&lt;/element&gt;</pre>

   </dd>

   <dt>Expected contexts:</dt>
   <!--
   <dd>The <code>xbl</code> element.</dd>
   <dd>The <code>svg:svg</code> element.</dd>
   <dd>The <code>html:head</code> element.</dd>
   <dd>The root element.</dd>
-->

   <dd>Any, but the ancestors must all be <span><a
    href="#correct">correct</a></span>.</dd>

   <dt>Expected children:</dt>

   <dd>None.</dd>
  </dl>

  <p>The <code><a href="#import0">import</a></code> element specifies a group
   of bindings to use. Unless explicitly imported using an <code><a
   href="#import0">import</a></code> element, binding definitions that
   declare attachments using the <code title="attr-definition-element"><a
   href="#element">element</a></code> attribute are only used in the document
   that defines them.</p>

  <p>The <code><a href="#import0">import</a></code> element may occur
   anywhere, within and without <span title="XBL subtree"><a
   href="#xbl-subtree">XBL subtrees</a></span>.</p>

  <h4 class="no-toc no-num" id="attributes4">Attributes</h4>

  <dl>
   <dt><dfn id="id5" title="attr-import-id">id</dfn></dt>

   <dd>The <span title="attr-id"><a href="#id6"><code>id</code>
    attribute</a></span>.</dd>

   <dt><dfn id="bindings" title="attr-xbl-import-bindings">bindings</dfn></dt>

   <dd>
    <p>The <code title="attr-import-bindings">bindings</code> attribute
     specifies the URI of the bindings to import. If it has a fragment
     identifier it specifies the subpart of the specified resource to examine
     for binding attachment declarations. This attribute is required. If it
     is omitted, the element is <span><a href="#in-error">in
     error</a></span>.</p>

    <p>The URI must point to an SVG document. If the URI designated by an
     <code><a href="#import0">import</a></code> element has a fragment
     identifier, it must point to an <code><a href="#xbl0">xbl</a></code>
     element in the specified document. If it does not, the element is in
     error.</p>

    <p>If the URI designated by an <code><a href="#import0">import</a></code>
     element cannot be resolved, or returns an HTTP 404 error (or
     equivalent), or does not point to a resource with an
     <code>image/svg+xml</code> MIME type, or has any other problem that
     makes it unusable, then the element is in error.</p>

   </dd>
  </dl>

  <p>When an <code><a href="#import0">import</a></code> element is parsed or
   inserted into a document, and whenever the <code
   title="attr-import-bindings">bindings</code> attribute is subseqently
   changed, the URI specified by its <code
   title="attr-import-bindings">bindings</code> attribute must be loaded
   (unless it has <span title="loading external resources"><a
   href="#loading1">already been loaded</a></span>).</p>

  <p>If the URI designated by an <code><a href="#import0">import</a></code>
   element cannot be resolved, or returns an HTTP 404 error, or does not
   point to a resource with an XML MIME type, or has any other problem that
   makes it unusable, then the element is <span><a href="#in-error">in
   error</a></span>.</p>

  <p>While the <code><a href="#import0">import</a></code> element remains in
   the document, all the bindings that it imports and that specify an
   attachment must be attached to any matching elements that have the same
   <code>ownerDocument</code> as the <code><a
   href="#import0">import</a></code> element. (See: <span title="binding
   attachment and detachment"><a href="#binding8">binding
   attachment</a></span>.)</p>

  <p>If there is a fragment identifier, it imports all the <code><a
   href="#definition0">definition</a></code> elements in the subtree
   designated by that fragment identifier. Otherwise, it imports all the
   <code><a href="#definition0">definition</a></code> elements in the
   <span><a href="#binding7">binding document</a></span>.</p>

  <p>An import is <em>live</em>, if new <code><a
   href="#definition0">definition</a></code> elements are added to a subtree
   that is being imported by a document, then the new bindings are
   immediately applied to that document. Similarly, if an <code><a
   href="#import0">import</a></code> element is removed, or if the <code
   title="attr-import-bindings">bindings</code> attribute is changed, then
   the bindings it was importing are detached from any elements they were
   affecting.</p>

  <p>XBL bindings are always implicitly imported into the document in which
   they are defined.</p>

  <div class="example">
   <p>An XBL subtree that defines some bindings is automatically imported in
    that document, so such mappings are always used. The following example
    demonstrates this.</p>

   <pre><strong>example.svg</strong>

&lt;svg xmlns="http://www.w3.org/2000/svg" ...&gt;

 &lt;xbl xmlns="http://www.w3.org/2004/xbl" ...&gt;
  &lt;definition element="foo"&gt;
   ...
  &lt;definition&gt;
  &lt;definition element="bar"&gt;
   ...
  &lt;definition&gt;

 &lt;/xbl ...&gt;
 &lt;foo xmlns=""/&gt; &lt;!-- this will have a binding applied --&gt;
 &lt;bar xmlns=""/&gt; &lt;!-- this will have a binding applied --&gt;
&lt;/svg&gt;
</pre>

   <p>If the binding definitions are in a separate file, then that file needs
    to be imported explicitly:</p>

   <pre><strong>widgets.svg</strong>

&lt;svg xmlns="http://www.w3.org/2000/svg" ...&gt;
 &lt;xbl xmlns="http://www.w3.org/2004/xbl" ...&gt;
  &lt;definition element="foo"&gt;
   ...
  &lt;definition&gt;

  &lt;definition element="bar"&gt;
   ...
  &lt;definition&gt;
 &lt;/xbl ...&gt;
&lt;/svg&gt;
</pre>

   <pre><strong>example.svg</strong>

&lt;svg:svg ...
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns:xbl="http://www.w3.org/2004/xbl"&gt;
 <em>&lt;xbl:import bindings="widgets.svg"/&gt;</em>
 &lt;foo/&gt; &lt;!-- bound --&gt;
 &lt;bar/&gt; &lt;!-- bound --&gt;
&lt;/svg:svg&gt;

</pre>

   <p>If a file imports a specific binding but the file containing that
    binding has its own <code><a href="#import0">import</a></code> elements,
    the second import only affects nodes in that document. For example:</p>

   <pre><strong>foo.svg</strong>

&lt;svg xmlns="http://www.w3.org/2000/svg" ...&gt;
 &lt;xbl xmlns="http://www.w3.org/2004/xbl" ...&gt;

  &lt;definition element="foo" id="foo"&gt;
   &lt;content&gt;
    &lt;bar xmlns=""/&gt; &lt;!-- not bound, not even when in shadow content --&gt;
   &lt;/content&gt;
  &lt;definition&gt;

 &lt;/xbl&gt;
&lt;/svg&gt;
</pre>

   <pre><strong>bar.svg</strong>

&lt;svg xmlns="http://www.w3.org/2000/svg" ...&gt;
 &lt;xbl id="bindings" xmlns="http://www.w3.org/2004/xbl" ...&gt;
  &lt;definition element="bar" id="bar"&gt;

   &lt;content&gt;
    &lt;foo xmlns=""/&gt; &lt;!-- bound: this document imports foo.svg --&gt;
    &lt;bar xmlns=""/&gt; &lt;!-- bound: bar binding is defined locally --&gt;
   &lt;/content&gt;
  &lt;definition&gt;

 &lt;/xbl&gt;
 &lt;import bindings="foo.svg" xmlns="http://www.w3.org/2004/xbl"/&gt;
&lt;/svg&gt;
</pre>

   <pre><strong>example.svg</strong>

&lt;svg:svg ...
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns:xbl="http://www.w3.org/2004/xbl"&gt;
 &lt;xbl:import bindings="bar.svg#bindings"/&gt;

 &lt;foo/&gt; &lt;!-- not bound: foo.svg not imported here --&gt;
 &lt;bar/&gt; &lt;!-- bound --&gt;
&lt;/svg:svg&gt;
</pre>
  </div>

  <h3 id="the-id"><span class="secno">2.7. </span>The <dfn id="id6"
   title="attr-id">id</dfn> attribute of XBL elements</h3>

  <dl>
   <dt>RelaxNG language definition:</dt>

   <dd>
    <pre class="schema">&lt;define name='id.attrib'&gt;
  &lt;optional&gt;
    &lt;attribute name='id'&gt;

      &lt;data type='ID'/&gt;
    &lt;/attribute&gt;
  &lt;/optional&gt;
&lt;/define&gt;</pre>
   </dd>

   <dt>Expected element:</dt>

   <dd>Any element in the XBL namespace.</dd>
  </dl>

  <p>The <code title="attr-id"><a href="#id6">id</a></code> attribute assigns
   a name to an element. This name must be unique in the document. The <code
   title="attr-id"><a href="#id6">id</a></code> attribute is of type ID.
   Refer to the "Extensible Markup Language (XML)" Recommendation <a
   href="#refsXML">[XML]</a>.</p>

  <p>An <code title="attr-id"><a href="#id6">id</a></code> attribute's value
   must be valid, as defined by XML. (See XML 1.0, <a
   href="http://www.w3.org/TR/REC-xml/#id">section 3.3.1</a>.)</p>

  <p class="issue">What does it mean to require that the ID attribute must be
   valid? Does it mean "must match XML's Name production"? What if it isn't?
   Does it put it in error? If it is in error, what happens; is that covered
   by our new "in error" handling text?</p>

  <h2 id="binding"><span class="secno">3. </span><dfn id="binding8">Binding
   Attachment and Detachment</dfn></h2>

  <p>Bindings shall be attached as soon as the following conditions have been
   met: (a) it is known that the element is bound to the given binding (b)
   the element has been created and (c) the binding has loaded.</p>

  <h3 id="interpretation"><span class="secno">3.1. </span><dfn
   id="interpretation1">Interpretation of URIs to XBL bindings</dfn></h3>

  <p>The sXBL attachment mechanism can use a URI to specify which binding to
   attach to the designated element:</p>

  <pre class="example">&lt;definition element="my:foo"
            ref="<strong>http://www.example.org/bindings.xml#fooBinding</strong>"/&gt;</pre>

  <p>This section defines how URIs in the <code><a
   href="#definition0">definition</a></code> element's <code
   title="attr-definition-ref"><a href="#ref">ref</a></code> attribute are to
   be interpreted.</p>

  <p>The URI specifies a particular <span><a href="#binding7">binding
   document</a></span> (a document with SVG fragments containing one or more
   XBL subtrees).</p>

  <p>If the URI contains a fragment identifier, it must point to a specific
   <code><a href="#definition0">definition</a></code> element (by <code
   title="attr-id"><a href="#id6">id</a></code>) within an XBL subtree in the
   specified document, and that element must be a direct child of an <code><a
   href="#xbl0">xbl</a></code> element that does not itself have an <code><a
   href="#xbl0">xbl</a></code> element as an ancestor.</p>

  <p>If there is no fragment identifier the URI does not point to a correct
   binding and is <span><a href="#in-error">in error</a></span>.</p>

  <h3 id="attachment"><span class="secno">3.2. </span><dfn id="attachment1"
   title="attachment using bind">Attachment using
   <code>definition</code></dfn></h3>

  <p>The binding mechanism is the <code><a
   href="#definition0">definition</a></code> element. It declares which
   bindings should be attached to which elements.</p>

  <p>While an element matches the <code title="attr-definition-element"><a
   href="#element">element</a></code> attribute of one of the <code><a
   href="#definition0">definition</a></code> elements that is <span
   title="import"><a href="#import0">imported</a></span> into, or defined in,
   the element's document, the binding defined by the first such <code><a
   href="#definition0">definition</a></code> element must be bound to the
   element.</p>

  <p>A <code title="attr-definition-ref"><a href="#ref">ref</a></code>
   attribute may be used to defer the definition of the binding to another
   <code><a href="#definition0">definition</a></code> element. (See: <span
   title="definition"><a href="#definition0">the definition
   element</a></span>.)</p>

  <h3 id="binding0"><span class="secno">3.3. </span><dfn
   id="binding9">Binding Attachment Model</dfn></h3>

  <p>When a new binding is attached, the UA must perform the following steps
   in order (or act as if it did). Implementations may choose to suspend
   redraw during this process.</p>

  <ol>
   <li>Events must start being routed through the binding's <code><a
    href="#handlergroup0">handlerGroup</a></code> element, when there is one.
    (See: <span><a href="#event6">event forwarding</a></span>.)</li>

   <li> The <span><a href="#shadow5">shadow content template</a></span> is
    then cloned, if needed, to create the <span><a href="#shadow3">shadow
    tree</a></span>:
    <ol>

     <li>If the new binding has a shadow content template, then a new shadow
      tree is created. The <code class="dom"><a
      href="#prebind">prebind</a></code> event is fired before it is
      attached. (See: <span><a href="#rules1">rules for shadow content
      generation</a></span>.)</li>

     <li>Otherwise, if the binding has no shadow tree, a <code class="dom"><a
      href="#prebind">prebind</a></code> event in the XBL namespace that
      bubbles but is not cancelable is fired on the bound element.</li>
    </ol>

   </li>

   <li>Any bindings of descendants that are not yet attached, are then
    attached.</li>

   <li>Once all the bindings of any descendent elements are attached, a <code
    class="dom"><a href="#bound1">bound</a></code> event in the XBL namespace
    that bubbles but is not cancelable is fired on the bound element.</li>
  </ol>

  <p class="issue">We need to decide how to handle the case where a binding's
   <code><a href="#definition0">definition</a></code> is removed while it is
   being attached.</p>

  <!--
What should happen if a binding is detached while it's in the middle of the 
attachment process (for example, say the prebind event handling removes some 
<xbl:import> nodes from the document)?  Or the prebind or bound events on its 
descendants cause the binding to be detached before its bound event would have 
fired?
-->

  <h3 id="binding1"><span class="secno">3.4. </span>Binding Detachment Model</h3>

  <p>Before a binding is detached, an <code class="dom"><a
   href="#unbinding">unbinding</a></code> event in the XBL namespace that
   bubbles but is not cancelable is fired on the bound element.</p>

  <p>The shadow content nodes, the shadow tree, any forwarding of events to
   the binding, etc, are then removed from the element.</p>

  <h3 id="summary"><span class="secno">3.5. </span>Summary of Events</h3>

  <p>The following events are fired during attachment and detachment:</p>

  <dl>
   <dt>{"http://www.w3.org/2004/xbl", "<dfn id="prebind">prebind</dfn>"}</dt>

   <dd>A new binding is in the process of being attached to the event target.
    This event is fired after the contents of the <code><a
    href="#template0">template</a></code> element, if any, have been cloned
    but before attachment to the bound element's <code><a
    href="#xblshadowtree">xblShadowTree</a></code> and recursive XBL
    processing on shadow tree contents. (See: <span><a
    href="#binding9">binding attachment model</a></span>.)</dd>

   <dt>{"http://www.w3.org/2004/xbl", "<dfn id="bound1">bound</dfn>"}</dt>

   <dd>A new binding has been attached to the event target, and all of its
    descendants in the <span><a href="#final">final flattened tree</a></span>
    for which bindings are to be applied have had the <code><a
    href="#bound1">bound</a></code> event fired on them.</dd>

   <dt>{"http://www.w3.org/2004/xbl", "<dfn id="unbinding">unbinding</dfn>"}</dt>

   <dd>A binding is being detached from the event target. This event is fired
    before the current contents of <code><a
    href="#xblshadowtree">xblShadowTree</a></code> are removed before the
    value of <code><a href="#xblshadowtree">xblShadowTree</a></code> is set
    to null.</dd>
  </dl>

  <p>All of these events bubble and cannot be canceled.</p>

  <p>The <code><a href="#prebind">prebind</a></code> event must use the
   following interface:</p>

  <pre class="idl">interface ShadowTreeEvent : Event {
  readonly attribute <code>XBLTemplateElement</code> xblShadowTree;
  void               initShadowTreeEvent(in DOMString typeArg, 
                                         in boolean canBubbleArg, 
                                         in boolean cancelableArg, 
                                         in XBLTemplateElement xblShadowTreeArg);
  void               initShadowTreeEventNS(in DOMString namespaceURIArg,
                                           in DOMString typeArg, 
                                           in boolean canBubbleArg, 
                                           in boolean cancelableArg, 
                                           in XBLTemplateElement xblShadowTreeArg);
};</pre>

  <p>The two methods initialise the event in a manner analogous to other
   events in DOM3 Events. <a href="#refsDOM3EVENTS">[DOM3EVENTS]</a></p>

  <p>The <code title="">xblShadowTree</code> member must contain a pointer to
   the shadow tree being constructed, if any, and must be null otherwise.</p>

  <h3 id="script"><span class="secno">3.6. </span><dfn id="script1">Script
   contexts</dfn></h3>

  <p>Script must always be executed in the script context of the document
   specified by the script's element's <code class="dom">ownerDocument</code>

   DOM attribute. This implies that scripts from different bindings in the
   same binding doucment bound to different elements in the same bound
   document share the same scripting scope. If the bindings were defined in
   the document itself, then the scope is the same scope as for that
   document.</p>

  <h2 id="shadow"><span class="secno">4. </span><dfn id="shadow6">Shadow
   Content</dfn></h2>

  <p>A binding can specify a <span><a href="#shadow5">shadow content
   template</a></span> using the <code><a
   href="#template0">template</a></code> element. This template describes a
   content tree that will be generated under the bound element during binding
   attachment. An element declared in a bound document using a single element
   can then be constructed out of multiple child elements, and this
   implementation is hidden from the bound document.</p>

  <p>When the shadow content template is cloned (as described in this
   section), the clone is called a <span><a href="#shadow3">shadow
   tree</a></span>.</p>

  <h3 id="rules"><span class="secno">4.1. </span><dfn id="rules1">Rules for
   Shadow Content Generation</dfn></h3>

  <p>Whenever bindings are attached to an element, shadow content will
   potentially be generated or destroyed.</p>

  <p>When a <code><a href="#template0">template</a></code> element is mutated
   in any way, any bindings whose shadow tree was constructed from that
   element must be reconstructed as described in this section.</p>

  <p>If a <code><a href="#definition0">definition</a></code> element that had
   no <code><a href="#template0">template</a></code> element has a <code><a
   href="#template0">template</a></code> element added, then a shadow tree is
   generated. If the <code><a href="#template0">template</a></code> element
   is removed, then the shadow tree is destroyed.</p>

  <p>Everything described in this section up to the firing of the event, and
   everything described in this section after the firing of the event, must
   be completed atomically &mdash; that is, the UA must not execute author
   scripts during those two parts of the process. User agents may optimise
   this algorithm so long as the end result is the same.</p>

  <p>If the binding has a shadow content template, then its <code><a
   href="#template0">template</a></code> element is deeply cloned. Otherwise,
   no shadow content will be generated for the bound element, its <code
   class="dom"><a href="#xblshadowtree">xblShadowTree</a></code> attribute
   will be <code class="dom">null</code>, and its <code class="dom"><a
   href="#xblchildnodes">xblChildNodes</a></code> attribute will equal its
   <code class="dom">childNodes</code> attribute.</p>

  <p>The <code>xml:base</code> data of the cloned nodes must be set so that
   the <code class="dom">baseURI</code> of nodes in the resulting shadow tree
   is the same as their pre-cloning counterparts. All shadow nodes'
   <code>ownerDocument</code> pointers are left pointing at the binding
   document's <code class="dom">Document</code> node.</p>

  <p>The newly cloned <code><a href="#template0">template</a></code> element
   is then renamed to be a <dfn id="shadowtree"
   title="shadowTree"><code>shadowTree</code> element</dfn> in the XBL
   namespace.</p>

  <p>No mutation events must be fired during the above steps.</p>

  <p>A <code class="dom"><a href="#prebind">prebind</a></code> event in the
   XBL namespace that bubbles but is not cancelable is fired on the bound
   element, with the <code><a href="#shadowtree">shadowTree</a></code>

   element as the event data.</p>

  <p>The bound element's <code class="dom"><a
   href="#xblshadowtree">xblShadowTree</a></code> attribute is set to point
   to the root <code><a href="#shadowtree">shadowTree</a></code> element of
   this tree of clones.</p>

  <p>The shadow tree is then applied to the bound element: the <code><a
   href="#xbl0">xbl*</a></code> DOM attributes are updated and the CSS
   cascade and inheritance should be computed.</p>

  <p class="note">Some implementations might optimize this algorithm, such as
   using "lazy evaluation" approaches and thereby postpone the cascade and
   inheritance operations.</p>

  <h3 id="processing"><span class="secno">4.2. </span><dfn
   id="processing1">Processing <code>content</code> elements</dfn></h3>

  <p>The shadow content template may contain <code><a
   href="#content0">content</a></code> elements that define where explicit
   children should be inserted in the shadow content.</p>

  <p class="issue">What about nested bindings, where the inner bound element
   is the parent of a <code><a href="#content0">content</a></code> element
   and itself has a template with <code><a
   href="#content0">content</a></code> elements? Do the inner content
   elements match the repositioned explicit elements, or the inner <code><a
   href="#content0">content</a></code> element? If the former, we need to
   define this. The latter would mean encapsulation was broken.</p>
  <!-- Note: alt="" is correct for the following image, since the
       paragraph says everything the image says. -->

  <p><img alt="" class="extra" src="images/xbl_image_1.png" />XBL bindings
   can interleave shadow content between bound elements and their explicit
   children. They do so using XBL's <code><a
   href="#content0">content</a></code> element. Any number of <code><a
   href="#content0">content</a></code> nodes may be used in a binding's
   shadow content template.</p>

  <p>Expressions specified using the <code title="attr-content-includes"><a
   href="#includes">includes</a></code> attribute determine which <code><a
   href="#content0">content</a></code> element a given child should be placed
   under.</p>

  <div class="issue" id="includes-syntax">
   <p><strong>Request for public feedback</strong></p>

   <p>The XBL task force has requested feedback on the syntax to use for
    <code>includes</code> attribute. Almost all comments suggested that XPath
    (or an XPath subset) is preferred. <a
    href="http://www.w3.org/TR/xslt#patterns">XPath Patterns</a> are already
    used in XSLT, so many Web authors are already familiar with them.</p>

   <p>It has been suggested that XPath Patterns may be expensive to compute.
    Due to the highly dynamic nature of bindings, especially in the context
    of bindings for user interfaces, the expressions used in <code><a
    href="#content0">content</a></code> elements need to be very fast to
    resolve. Implementation feedback is explicitly requested on the
    performance of CSS3 Selectors compared to equivalent XPath 1.0 Patterns.</p>

   <p>One problem in deciding whether Selectors or XPath is the better
    solution is that XBL is targetted at several audiences, including a
    primarily HTML4- and CSS-driven audience, and a primarily XML-driven
    audience (XHTML authors, SVG authors, XML developers). The former may be
    more familiar with Selectors, and the latter more familiar with XPath.</p>
  </div>

  <p>If no <code title="attr-content-includes"><a
   href="#includes">includes</a></code> attribute is specified, a <code><a
   href="#content0">content</a></code> element is considered generic and will
   match on all content, including text nodes, CDATA nodes, comments, and so
   on.</p>

  <p>The <code><a href="#content0">content</a></code> element used for a
   given piece of content is the first encountered with an expression that
   matches the element when doing a pre-order, depth-first walk of the shadow
   content template.</p>

  <p>The <code><a href="#content0">content</a></code> element itself is
   present in the shadow content, but is not visible in the <code
   class="dom"><a href="#xblchildnodes">xblChildNodes</a></code> list. In
   that list, it is simply replaced by the elements that matched it, or, if
   there were no matches, by its contents.</p>

  <p>If an explicit child of the bound element does not match any of the
   <code><a href="#content0">content</a></code> element in the shadow tree
   (or if there are no <code><a href="#content0">content</a></code> elements
   in the shadow tree), then that child does not appear in the <span><a
   href="#final">final flattened tree</a></span>.</p>

  <h3 id="handling"><span class="secno">4.3. </span>Handling DOM Changes</h3>

  <p>All of the nodes in the shadow tree are live. Whenever an element is
   inserted into, removed from, or appended to the DOM, all the children must
   check that their assigned <code><a href="#content0">content</a></code>
   element is still appropriate, following all the same rules that applied
   when first placing explicit children during shadow content generation. If
   one or more nodes stop fitting into any of the <code><a
   href="#content0">content</a></code> elements then they no longer appear in
   the <span><a href="#final">final flattened tree</a></span>.</p>

  <p>It is possible to manipulate the shadow content contained underneath a
   bound element using standard DOM APIs. If shadow content that contains a
   <code><a href="#content0">content</a></code> element is removed, then any
   explicit children assigned to that element are relocated to the first
   <code><a href="#content0">content</a></code> elements that match them.</p>

  <p>Whenever the subtree of a <code><a href="#template0">template</a></code>
   element is dynamically modified, any shadow trees that were constructed by
   cloning that element must be reconstructed. (As no events are fired during
   this process, there is no way for such bindings to update their shadow
   trees after it happens.)</p>

  <h3 id="shadow0"><span class="secno">4.4. </span>Shadow Content and CSS</h3>

  <p>Special care should be used when considering the interactions of CSS and
   XBL.</p>

  <h4 id="terminology0"><span class="secno">4.4.1. </span>Terminology</h4>

  <p>Shadow content introduces the concept of <dfn id="shadow7">shadow
   scope</dfn> to nodes within a document. Because shadow content elements
   can also have bindings attached that generate their own shadow content,
   this scoping can be taken to an arbitrary level of nesting.</p>

  <p>Explicit content is said to be at the <dfn
   id="document-level">document-level scope</dfn>, which is the highest, or
   outermost, shadow scope. Shadow content nodes are in their own <dfn
   id="binding-level">binding-level shadow scopes</dfn>. Binding scopes are
   determined by the bound element that contains the binding responsible for
   the generation of the shadow nodes. The bound element itself is in the
   shadow scope of the content around it, and its binding's shadow content is
   in a deeper shadow scope. Shadow content that contains no elements that
   are themselves bound is said to be in the deepest, or innermost, shadow
   scope.</p>

  <p>The resulting tree, after all children have been assigned to <code><a
   href="#content0">content</a></code> elements, is called the <dfn
   id="final">final flattened tree</dfn>, and is the tree used by the
   rendering model. (See: <span><a href="#selectors1">selectors and shadow
   scopes</a></span>.)</p>

  <h4 id="selectors"><span class="secno">4.4.2. </span><dfn
   id="selectors1">Selectors and Shadow Scopes</dfn></h4>

  <p>Bindings can interleave shadow elements between the bound element and
   its explicit children. (See: <span><a href="#processing1">processing <code
   title="">content</code> elements</a></span>.) In this situation, a new
   tree emerges that is different from the explicit content node tree. In
   addition to having a single explicit parent (the bound element) and a
   single set of children (the explicit children in the DOM tree), elements
   also have a set of shadow parents and and shadow children (introduced by
   bindings when <code><a href="#content0">content</a></code> elements were
   used). This necessarily affects the CSS model.</p>

  <p><em>Combinators:</em> CSS combinators, in the presence of XBL, must act
   as follows. This is intended to match the definitions of CSS in all cases
   other than when a selector would involve the XBL elements.</p>

  <dl>
   <dt>A&gt;B</dt>

   <dd>
    <p>If "<code>B.parentNode</code>" is an insertion point (a <code><a
     href="#content0">content</a></code> element), let "<code>X</code>" be
     "<code>B.parentNode.parentNode</code>", otherwise let "<code>X</code>"
     be "<code>B.parentNode</code>".</p>

    <p>Now if "<code>X</code>" is the root of a shadow tree, it doesn't match
     "<code>B</code>".</p>

    <p>Otherwise, it matches "<code>B</code>" if the "<code>X</code>" element
     is the "<code>A</code>" element.</p>

   </dd>

   <dt>A&nbsp;B</dt>

   <dd>Matches "<code>B</code>" if either "<code>A&gt;B</code>" matches
    "<code>B</code>", or "<code>C&gt;B</code>" matches "<code>B</code>" and
    "<code>A&nbsp;C</code>" matches "<code>C</code>".</dd>

   <dt>A+B</dt>

   <dd>If "<code>B.previousSibling</code>" is an insertion point (a <code><a
    href="#content0">content</a></code> element), it doesn't match
    "<code>B</code>", otherwise, it matches if
    "<code>B.previousSibling</code>" is "<code>A</code>".</dd>

   <dt>A~B</dt>

   <dd>Matches "<code>B</code>" if either "<code>A+B</code>" matches
    "<code>B</code>", or if "<code>C+B</code>" matches "<code>B</code>" and
    "<code>A~C</code>" matches "<code>C</code>".</dd>

  </dl>

  <p><em>Pseudo-classes and pseudo-elements:</em> Pseudo-classes and
   pseudo-elements are unchanged in the presence of XBL. They operate
   exclusively on the core DOM.</p>

  <div class="example">
   <p>In particular, note that this means that the selector
    <code>:nth-child(odd)</code> would match both the <code>A</code> and
    <code>B</code> nodes in the following example:</p>

   <pre>&lt;xbl:template>
  &lt;A/>
  &lt;xbl:content>
  &lt;B/>
 &lt;/xbl:template></pre>

   <p>...regardless of the number of nodes that are inserted at the insertion
    point given by the <code><a href="#content0">content</a></code> element
    (whether that be 0, 1, 2, or more nodes).</p>
  </div>

  <p><em>Inheritance:</em> The final modified content tree determines how CSS
   properties (e.g., fonts and colors) are inherited. An element either ends
   up underneath its explicit parent (just as in the content model), or it
   ends up being nested through a series of <code><a
   href="#content0">content</a></code> elements. When nested, it inherits
   from the innermost shadow parent.</p>

  <p>In DOM terms, this corresponds to inheritance using the <code
   class="dom"><a href="#xblparentnode">xblParentNode</a></code> attribute.</p>

  <h3 id="shadow1"><span class="secno">4.5. </span>Shadow Content and
   <code>xml:base</code></h3>

  <p class="note">This section is intended to re-iterate what the
   <code>xml:base</code> specification already states, in case there is any
   question about how <code>xml:base</code> processing should work in shadow
   trees.</p>

  <p>Relative <code>xml:base</code>s on nodes in shadow trees are resolved
   relative to their <code>parentNode</code>, or the
   <code>ownerDocument</code> if there is no <code>parentNode</code>.</p>

  <h3 id="binding2"><span class="secno">4.6. </span><dfn
   id="binding10">Binding Stylesheets</dfn></h3>

  <p>Shadow content nodes must be styled using the stylesheets specified in
   the binding document.</p>

  <p>Bound elements must be styled using the sheets from their <span><a
   href="#shadow7">shadow scope</a></span>, not the stylesheets from their
   binding.</p>

  <p>If the binding document specifies alternate stylesheets, the stylesheets
   used must be those that are appropriate for the currently selected
   stylesheet set in that document. This may differ from the selected
   stylesheet set of the bound document.</p>

  <p>User agent sheets and user sheets are always applied to all shadow
   scopes.</p>

  <h2 id="event"><span class="secno">5. </span><dfn id="event5">Event
   Handlers</dfn></h2>

  <h3 id="event0"><span class="secno">5.1. </span><dfn id="event6">Event
   forwarding</dfn></h3>

  <p>Often, XBL developers will want to register the same event listener on
   all bound elements corresponding to a given <code><a
   href="#definition0">definition</a></code> element. For example, suppose
   your XBL contains the following <code><a
   href="#definition0">definition</a></code>:</p>

  <pre>&lt;xbl:definition element="myNS:button"&gt;
  ...
&lt;/xbl:definition&gt;</pre>

  <p>And suppose you create three instances of "myNS:button" as follows:</p>

  <pre>&lt;myNS:button id="b1"&gt;...&lt;/myNs:button&gt;

&lt;myNS:button id="b2"&gt;...&lt;/myNs:button&gt;
&lt;myNS:button id="b3"&gt;...&lt;/myNs:button&gt;</pre>

  <p>And suppose you want to attach a "DOMActivate" event listener to each of
   the three instances. You can certainly register three separate event
   listeners using either three separate event listener registration elements
   (e.g., in the case of SVG, you can use <code>svg:handler</code>) or using
   three separate DOM method calls (e.g., three calls to <code
   class="dom">EventTarget::addEventListener</code>). However, sometimes it
   is more convenient to define the event listener once as part of the
   <code><a href="#definition0">definition</a></code> element and then have
   the given event listener (in effect) automatically assigned to each bound
   element instance that corresponds to the given <code><a
   href="#definition0">definition</a></code>.</p>

  <p>In order to provide such convenience, XBL provides an automatic event
   forwarding mechanism for all events listeners attached to a <code><a
   href="#handlergroup0">handlerGroup</a></code> element.</p>

  <p>Every time an event fires on a bound element (whether during the
   capture, target, or bubbling phases), if any event listeners for the given
   event exist on the corresponding <code><a
   href="#handlergroup0">handlerGroup</a></code> element, then those
   listeners must be invoked.</p>

  <div class="example">

   <p>To illustrate, if we update the above example to add <code><a
    href="#handlergroup0">handlerGroup</a></code> and
    <code>svg:handler</code> elements as follows:</p>

   <pre>&lt;xbl:definition element="myNS:button"&gt;
   &lt;xbl:template&gt;...&lt;/xbl:template&gt;

   &lt;xbl:handlerGroup&gt;
      &lt;svg:handler ev:event="DOMActivate"...&gt;...&lt;/svg:handler&gt;
   &lt;/xbl:handlerGroup&gt;
&lt;/xbl:definition&gt;
...
&lt;myNS:button id="b1"&gt;...&lt;/myNs:button&gt;

&lt;myNS:button id="b2"&gt;...&lt;/myNs:button&gt;
&lt;myNS:button id="b3"&gt;...&lt;/myNs:button&gt;</pre>

   <p>The result is that the user agent must automatically attach an implicit
    "DOMActivate" event listener to each <code>myNS:button</code> element. If
    the DOMActivate event is fired and dispatched to any of the
    <code>myNS:button</code> elements, then the user agent must invoke
    DOMActivate event handlers defined by the <code>svg:handler</code>

    element.</p>
  </div>

  <p>Event listeners attached to the <code><a
   href="#handlergroup0">handlerGroup</a></code> element must always be fired
   after all the appropriate event listeners on the bound element itself, in
   both the capture and bubbling phase.</p>

  <p>Since XBL handlers usually constitute the default actions for a widget,
   this allows authors in the bound document to write event handlers that
   potentially suppress the default actions taken by the XBL handlers (by
   using the <code class="dom">stopImmediatePropagation()</code> method).</p>

  <h4 class="no-toc no-num" id="notes">Notes</h4>

  <ul>
   <li>The above example shows an event listener defined in markup. The event
    forwarding mechanism shall work with all event listeners attached to an
    <code><a href="#handlergroup0">handlerGroup</a></code> element, no matter
    whether the event listeners are defined in markup or via the DOM (i.e.,
    using <code class="dom">EventTarget::addEventListener</code>).</li>

   <li>The event object which is passed to the listener shall be the same
    event object that would have passed to an event listener registered on
    the bound element itself. Its <code class="dom">currentTarget</code>

    field shall always be set to the bound element.</li>

   <li>All automatically registered event listeners as described in this
    section shall receive the event after all handlers corresponding to
    manually defined event listeners on the bound element (e.g., event
    listeners defined by XML Events in explicit markup or <code
    class="dom">addEventListener</code> calls via the DOM). These event
    ordering rules shall apply to all phases (i.e., capture, target and
    bubbling).</li>

   <li>The automatic event forwarding mechanism shall only apply to the
    <code><a href="#handlergroup0">handlerGroup</a></code> element in the
    <code><a href="#definition0">definition</a></code> element. It must not
    be applied to other <code><a
    href="#handlergroup0">handlerGroup</a></code> elements.</li>

  </ul>

  <h3 id="event1"><span class="secno">5.2. </span><dfn id="event7">Event Flow
   and Targeting Across Shadow Scopes</dfn></h3>

  <p>DOM events can fire on shadow targets just as they can on explicit
   targets. As long as the event flows within the same shadow tree <span
   title="shadow scope"><a href="#shadow7">scope</a></span>, it is no
   different from the behavior outlined in the DOM Events specification.</p>

  <p>Events must flow through the final transformed content model (the
   <span><a href="#final">final flattened tree</a></span>) after all elements
   have been repositioned through the usage of <code><a
   href="#content0">content</a></code> elements.</p>

  <p>Whenever events originating from a shadow tree flow from a shadow
   element in that shadow tree to the bound element, one of two actions
   occurs. Either the event is retargeted so that the bound element becomes
   the target, or the event is stopped and flow proceeds to the next phase.
   Whenever an event is retargeted, the event is cloned, with the clone's
   <code class="dom">target</code> field set to the bound element. The
   original event pointing at the shadow content responsible for the event
   can be obtained from a new field of the event object, <code class="dom"><a
   href="#originalevent">originalEvent</a></code>, which is set to the event
   that was cloned.</p>

  <p>The action taken (retarget vs. stop) is specific to the event type. In
   general, UI events must be retargeted and mutation events must be stopped.
   Exceptions to the rule are noted below. The goal of this retargetting or
   stopping is to stop outer shadow scopes from being exposed to nodes from
   inner shadow scopes, and to stop outer shadow scopes from getting
   apparently meaningless events that only make sense in the context of inner
   shadow scopes.</p>

  <p>During the capture phase, the semantics are exactly reversed. The first
   node to see the event is the node after which bubbling stops; and the
   target node, when the event is passing through a node at a higher shadow
   scope than the event target, is always the bound element in whose shadow
   content the event target lies.</p>

  <h3 id="focus"><span class="secno">5.3. </span>Focus, DOMFocusIn, Blur, and
   DOMFocusOut Events</h3>

  <p>If shadow content underneath a focusable bound element loses focus and
   shadow content also underneath the bound element takes focus, then both
   focus change events must be stopped. As far as the bound element is
   concerned, it retains focus throughout the two events. (Other
   specifications may go into more detail as to how to determine if an
   element can be focussed.)</p>

  <p>The <span class="property">'nav-index'</span> property defined in the
   CSS UI module <a href="#refsCSS3UI">[CSS3UI]</a> can be used to specify
   the tab order for focusable elements. This property can be specified on
   shadow content. Each shadow scope has a unique tab order. The <span
   class="property">'nav-index'</span> values used in one shadow scope are
   ignored by other shadow scopes. The tab order is resolved in the shadow
   tree first to produce a list of elements in the tab order. This list is
   substituted in place of the bound element in the bound element's tree tab
   order.</p>

  <div class="example">
   <p>This example illustrates what happens with focus if the shadow tree
    contains focusable elements. The example shows a binding for an element
    named <code>FirstAndLastNames</code>. The shadow tree for the binding
    contains two SVG editable text fields, one for the first name and one for
    the last name.</p>

   <pre>&lt;svg viewBox="0 0 200 60"
     xmlns="http://www.w3.org/2000/svg" version="1.2"
     xmlns:xbl="http://www.w3.org/2004/xbl"
     xmsns:myNS="http://www.example.com"&gt;
   &lt;defs&gt;
     &lt;xbl:xbl&gt;

       <strong>&lt;xbl:definition element="myNS:FirstAndLastNames"&gt;</strong>
         &lt;xbl:template&gt;
           &lt;g font-size="16"&gt;
             &lt;text x="10"  y="10"&gt;First name:&lt;/text&gt;
             &lt;text x="110" y="10" <strong>id="C" editable="true" nav-index="1"</strong>/&gt;

             &lt;text x="10"  y="30"&gt;Last name:&lt;/text&gt;
             &lt;text x="110" y="30" <strong>id="D" editable="true" nav-index="2"</strong>/&gt;
           &lt;/g&gt;
         &lt;/xbl:template&gt;
       &lt;/xbl:definition&gt;

     &lt;/xbl:xbl&gt;
   &lt;/defs&gt;
   &lt;g transform="translate(20,30)"&gt;
     &lt;text x="10"  y="10"&gt;Customer number:&lt;/text&gt;
     &lt;text x="110" y="10" <strong>id="A" editable="true" nav-index="10"</strong>/&gt;

   &lt;/g&gt;
   &lt;g id="B" transform="translate(20,50)" nav-index="20"&gt;
     <strong>&lt;myNS:FirstAndLastNames/&gt;</strong>
   &lt;/g&gt;
&lt;/svg&gt;</pre>

   <p>Tabbing through the document will go from A to C to D, not C to D to A.</p>

  </div>

  <p>Because content in multiple shadow scopes can be focused, the CSS <code
   class="css">:focus</code> pseudo-element is hierarchical in the presence
   of XBL, with up to one element in each shadow scope matching the
   pseudo-class. Style rules can be written with the assumption that they
   will match (in the above example) both the file control and the element
   focused inside the file control. In other words, an arbitrary chain of
   elements can be in the <code class="css">:focus</code> state at the same
   time. (Further specifications may describe this in more detail.)</p>

  <h3 id="mouseover"><span class="secno">5.4. </span>Mouseover and Mouseout
   Events</h3>

  <p>Mouseover and mouseout events must be retargeted if the pointing device
   genuinely moves onto (enters) or is moved away (exits) the bound element
   (in addition to entering or exiting some shadow content). If, however, the
   user has simply moved the pointing device from one element in the shadow
   tree to another element in the same shadow tree, without entering or
   exiting the bound element itself, then the event must be stopped.</p>

  <h2 id="dom-interfaces"><span class="secno">6. </span><dfn
   id="dom-interfaces1">DOM Interfaces</dfn></h2>

  <p>XBL introduces a few XBL-specific interfaces.</p>

  <h3 id="the-nodexbl"><span class="secno">6.1. </span>The <dfn
   id="nodexbl0">NodeXBL</dfn> Interface</h3>

  <p>The <code class="dom"><a href="#nodexbl0">NodeXBL</a></code> interface
   contains methods for accessing shadow content and for obtaining shadow
   parents in the altered model. The interface is implemented by DOM nodes
   (regardless of whether they are currently involved with any XBL
   processing) and may be obtained using binding-specific casting methods on
   a Node interface.</p>

  <p>All nodes except <code>Notation</code> and <code>Attr</code> nodes must
   implement NodeXBL, not just element nodes.</p>

  <dl>
   <dt>IDL Definition</dt>

   <dd>
    <pre class="idl">
interface NodeXBL {
  readonly attribute Node            xblParentNode;
  readonly attribute NodeList        xblChildNodes;
<!--  readonly attribute NodeList        xblScopedChildNodes;
-->  readonly attribute Node            xblFirstChild;
  readonly attribute Node            xblLastChild;
  readonly attribute Node            xblPreviousSibling;
  readonly attribute Node            xblNextSibling;
  readonly attribute Element         xblFirstElementChild;
  readonly attribute Element         xblLastElementChild;
  readonly attribute Element         xblPreviousElementSibling;
  readonly attribute Element         xblNextElementSibling;

  readonly attribute Element         xblBoundElement;
  readonly attribute Element         xblShadowTree;
  readonly attribute NodeList        xblDefinitions;
};
</pre>
   </dd>

   <dt>Attributes</dt>

   <dd>
    <dl>
     <dt><dfn class="attribute-name" id="xblparentnode"><code
      class="dom">xblParentNode</code></dfn> of type <code
      class="dom">Node</code>, readonly</dt>

     <dd>The <code class="dom"><a
      href="#xblparentnode">xblParentNode</a></code> attribute's value is the
      element's ancestor in the <span><a href="#final">final flattened
      tree</a></span> after all shadow trees have been applied.
      <p>If the node was repositioned by a <code><a
       href="#content0">content</a></code> element, then this attribute has
       the same value as the <code class="dom">parentNode</code> attribute of
       the <code><a href="#content0">content</a></code> element responsible
       for the repositioning in the deepest shadow scope, except if that is
       the <code><a href="#shadowtree">shadowTree</a></code> element at the
       top of the shadow tree, in which case the <code class="dom"><a
       href="#xblparentnode">xblParentNode</a></code> attribute has the same
       value as the <code class="dom"><a
       href="#xblboundelement">xblBoundElement</a></code> attribute of that
       <code><a href="#content0">content</a></code> element.</p>

      <p>If the node is a node in a shadow tree that is not currently in the
       <span><a href="#final">final flattened tree</a></span> (for example,
       the <code><a href="#shadowtree">shadowTree</a></code> element at the
       top of the shadow tree is never in the <span><a href="#final">final
       flattened tree</a></span>), then this attribute returns <code
       class="dom">null</code>.</p>

      <p>If the node is in a shadow tree and has the <code><a
       href="#shadowtree">shadowTree</a></code> element at the top of the
       shadow tree as its <code class="dom">parentNode</code>, then this
       attribute returns the same value as the <code class="dom"><a
       href="#xblboundelement">xblBoundElement</a></code> attribute.</p>

      <p>If the node is in a shadow tree and has a <code><a
       href="#content0">content</a></code> element that is not in error as
       its <code class="dom">parentNode</code>, then this attribute returns
       the same value as the <code class="dom">parentNode</code> attribute on
       the <code><a href="#content0">content</a></code> element, except if
       <em>that</em> would be the <code><a
       href="#shadowtree">shadowTree</a></code> element at the top of the
       shadow tree, in which case it returns the same as value as the <code
       class="dom"><a href="#xblboundelement">xblBoundElement</a></code>

       attribute.</p>

      <p>Otherwise it returns the same as the <code
       class="dom">parentNode</code> attribute.</p>
     </dd>

     <dt><dfn class="attribute-name" id="xblchildnodes"><code
      class="dom">xblChildNodes</code></dfn> of type <code
      class="dom">NodeList</code>, readonly</dt>

     <dd>The <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> attribute is a NodeList
      that represents the children of the node after <code><a
      href="#content0">content</a></code> elements have been applied. This
      attribute can be used to navigate the content model according to XBL
      after bindings have moved explicit and shadow children using <code><a
      href="#content0">content</a></code> elements. The attribute's value is
      the same as <code class="dom">childNodes</code> if the node is not
      bound.</dd>
     <!--
          <dt><dfn class="attribute-name"><code class="dom">xblScopedChildNodes</code></dfn> of type <code class="dom">NodeList</code>, readonly</dt>

          <dd>The <code class="dom">xblScopedChildNodes</code>
          attribute is a NodeList that represents the children of the
          node after <code>content</code> elements have been applied,
          ignoring any nested bindings. The attribute's value is the
          same as <code class="dom">childNodes</code> if the node is
          not bound, and the same as the <code
          class="dom">xblChildNodes</code> attribute if there are no
          nested bindings.</dd>
-->

     <dt><dfn class="attribute-name" id="xblnextsibling"><code
      class="dom">xblNextSibling</code></dfn> of type <code
      class="dom">Node</code>, readonly</dt>

     <dd>This attribute returns the node that follows the current node in the
      <code class="dom"><a href="#xblparentnode">xblParentNode</a></code>'s
      <code class="dom"><a href="#xblchildnodes">xblChildNodes</a></code>
      list, or <code class="dom">null</code> if <code class="dom"><a
      href="#xblparentnode">xblParentNode</a></code> is <code
      class="dom">null</code> or if the current node is the last node in that
      <code class="dom"><a href="#xblchildnodes">xblChildNodes</a></code>

      list.</dd>

     <dt><dfn class="attribute-name" id="xblprevioussibling"><code
      class="dom">xblPreviousSibling</code></dfn> of type <code
      class="dom">Node</code>, readonly</dt>

     <dd>This attribute returns the node that precedes the current node in
      the <code class="dom"><a
      href="#xblparentnode">xblParentNode</a></code>'s <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list, or <code
      class="dom">null</code> if <code class="dom"><a
      href="#xblparentnode">xblParentNode</a></code> is <code
      class="dom">null</code> or if the current node is the first node in
      that <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list.</dd>

     <dt><dfn class="attribute-name" id="xblfirstchild"><code
      class="dom">xblFirstChild</code></dfn> of type <code
      class="dom">Node</code>, readonly</dt>

     <dd>This attribute returns the first node in the <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list, or <code
      class="dom">null</code> if the list is empty.</dd>

     <dt><dfn class="attribute-name" id="xbllastchild"><code
      class="dom">xblLastChild</code></dfn> of type <code
      class="dom">Node</code>, readonly</dt>

     <dd>This attribute returns the last node in the <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list, or <code
      class="dom">null</code> if the list is empty.</dd>

     <dt><dfn class="attribute-name" id="xblnextelementsibling"><code
      class="dom">xblNextElementSibling</code></dfn> of type <code
      class="dom">Element</code>, readonly</dt>

     <dd>This attribute returns the first element to follow the current node
      in the <code class="dom"><a
      href="#xblparentnode">xblParentNode</a></code>'s <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list, or <code
      class="dom">null</code> if <code class="dom"><a
      href="#xblparentnode">xblParentNode</a></code> is <code
      class="dom">null</code> or if there are no elements past the current
      node in that <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list.</dd>

     <dt><dfn class="attribute-name" id="xblpreviouselementsibling"><code
      class="dom">xblPreviousElementSibling</code></dfn> of type <code
      class="dom">Element</code>, readonly</dt>

     <dd>This attribute returns the first element to precede the current node
      in the <code class="dom"><a
      href="#xblparentnode">xblParentNode</a></code>'s <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list, or <code
      class="dom">null</code> if <code class="dom"><a
      href="#xblparentnode">xblParentNode</a></code> is <code
      class="dom">null</code> or if there are no elements before the current
      node in that <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list.</dd>

     <dt><dfn class="attribute-name" id="xblfirstelementchild"><code
      class="dom">xblFirstElementChild</code></dfn> of type <code
      class="dom">Element</code>, readonly</dt>

     <dd>This attribute returns the first element in the <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list, or <code
      class="dom">null</code> if the list contains no elements.</dd>

     <dt><dfn class="attribute-name" id="xbllastelementchild"><code
      class="dom">xblLastElementChild</code></dfn> of type <code
      class="dom">Element</code>, readonly</dt>

     <dd>This attribute returns the last element in the <code class="dom"><a
      href="#xblchildnodes">xblChildNodes</a></code> list, or <code
      class="dom">null</code> if the list contains no elements.</dd>

     <dt><dfn class="attribute-name" id="xblboundelement"><code
      class="dom">xblBoundElement</code></dfn> of type <code
      class="dom">Element</code>, readonly</dt>

     <dd>The <code class="dom"><a
      href="#xblboundelement">xblBoundElement</a></code> attribute is used to
      obtain the bound element with the binding attached that is responsible
      for the generation of the specified shadow node. This attribute enables
      an author to determine the shadow scope of any content node. For
      content at the <span><a href="#document-level">document-level
      scope</a></span>, the attribute's value is <code
      class="dom">null</code>.</dd>

     <dt><dfn class="attribute-name" id="xblshadowtree"><code
      class="dom">xblShadowTree</code></dfn> of type <code
      class="dom">Element</code>, readonly</dt>

     <dd>For bound elements with a shadow tree, the <code class="dom"><a
      href="#xblshadowtree">xblShadowTree</a></code> attribute returns the
      cloned copy of the <code><a href="#template0">template</a></code>
      element that represents the shadow content template of the element.
      (That element is renamed to <code><a
      href="#shadowtree">shadowTree</a></code> during shadow content
      generation.) For bound elements whose binding have no shadow content
      template, and for elements that are not bound, it returns <code
      class="dom">null</code>.</dd>

     <dt><dfn class="attribute-name" id="xbldefinitions"><code
      class="dom">xblDefinitions</code></dfn> of type <code
      class="dom">NodeList</code>, readonly</dt>

     <dd>For bound elements, a node list containing the <code><a
      href="#definition0">definition</a></code> element for the binding. In
      sXBL, this list contains at most one item.</dd>
    </dl>

   </dd>
  </dl>

  <h4 id="scoping"><span class="secno">6.1.1. </span>Scoping and Access Using
   the DOM</h4>

  <p>In effect the shadow content exists in its own insulated pocket within
   the document, its <span><a href="#shadow7">shadow scope</a></span>.
   Explicit parents have no knowledge of their shadow children in terms of
   DOM Core <a href="#refsDOM3CORE">[DOM3CORE]</a>. The shadow content is not
   accessible via the <code class="dom">childNodes</code> list for the bound
   element, nor is it accessible using <code
   class="dom">firstChild</code>/<code class="dom">nextSibling</code> to
   iterate over the children of the bound element.</p>

  <p>The shadow scope of an element can be determined using the <code
   class="dom"><a href="#xblboundelement">xblBoundElement</a></code> property
   on the <code class="dom"><a href="#nodexbl0">NodeXBL</a></code> interface.
   This returns the bound element in the enclosing shadow scope that is
   responsible for the shadow node. If invoked on an element at the <span><a
   href="#document-level">document-level scope</a></span>, it returns <code
   class="dom">null</code>.</p>

  <p>DOM methods that can be invoked on elements (e.g., <code
   class="dom">getElementsByTagName</code>) will only see nodes that are in
   the same shadow scope. Methods invoked on the document (e.g., <code
   class="dom" title="">getElementById</code>) only see nodes that are at the
   document-level scope.</p>

  <p>On shadow content nodes, <code class="dom">ownerDocument</code> always
   points to the document from which the nodes were cloned.</p>

  <p>Elements in different shadow scopes may have clashing IDs. IDs need only
   be unique within each shadow scope.</p>

  <p>Elements that are the root of a shadow tree (that is, cloned <code><a
   href="#shadowtree">shadowTree</a></code> elements that can be accessed by
   an <code><a href="#xblshadowtree">xblShadowTree</a></code> attribute)
   cannot be inserted into a document. Any attempt to do so must raise a
   <code class="dom">HIERARCHY_REQUEST_ERR</code>. <!-- (This is because if
  you did, you would end up having two ways to reach the nodes in the
  <span>final flattened tree</span>, which would be rather bad for the xbl* traversal
  attributes!.) --></p>

  <h4 id="dom-traversals"><span class="secno">6.1.2. </span><dfn
   id="dom-traversals1">DOM Traversals in the Presence of XBL</dfn></h4>

  <p>When the DOM is navigated using the normal DOM Core attributes, starting
   from the document, the UA must represent the original DOM, with no XBL
   nodes and shadow content, and with children of bound elements in their
   original order.</p>

  <p>The <code class="dom"><a href="#xblshadowtree">xblShadowTree</a></code>
   attribute on bound elements returns the element that was cloned from the
   XBL <code><a href="#template0">template</a></code> element. (That element
   is renamed to <code><a href="#shadowtree">shadowTree</a></code> during
   shadow content generation.) Manipulating the shadow content tree must
   directly affect the content under the bound element. <code><a
   href="#content0">content</a></code> elements may be moved about or even
   removed altogether, etc, and all these changes must be immediately
   reflected in the DOM.</p>

  <p>Because each bound element gets its own copy of the cloned template,
   changes to a bound element's shadow content only affect that bound
   element. Other bindings are unaffected.</p>
  <!-- XXXX -->

  <p>If an element is added to the DOM dynamically, its shadow scope is that
   of its parent element. Adding an element as a child of a bound element
   causes that element to be assigned to an appropriate <code><a
   href="#content0">content</a></code> element (if there is one &mdash; if
   there is not, the element does not appear anywhere in the <span><a
   href="#final">final flattened tree</a></span>).</p>

  <h4 id="example"><span class="secno">6.1.3. </span>Example of XBL DOM
   Traversals</h4>

  <div class="example">
   <p>Imagine the following document fragment:</p>

   <pre>...
 &lt;A&gt;
  &lt;B&gt;

   &lt;C/&gt;
   &lt;D/&gt;
  &lt;/B&gt;
 &lt;/A&gt;
...</pre>

   <p>...is bound to the following XBL:</p>

   <pre>&lt;xbl:xbl xmlns:xbl="http://www.w3.org/2004/xbl"&gt;
 &lt;xbl:definition element="B"&gt;
  &lt;xbl:template&gt;
   &lt;P&gt;
    &lt;Q&gt;
     &lt;xbl:content includes="C"&gt;

      &lt;R/&gt;
     &lt;/xbl:content&gt;
    &lt;/Q&gt;
    &lt;xbl:content includes="D"&gt;
     &lt;S/&gt;
    &lt;/xbl:content&gt;

   &lt;/P&gt;
  &lt;/xbl:template&gt;
 &lt;/xbl:definition&gt;
 &lt;xbl:definition element="Q"&gt;
  &lt;xbl:template&gt;
   &lt;X&gt;

    &lt;Y&gt;
     &lt;xbl:content&gt;
      &lt;Z1/&gt;
     &lt;/xbl:content&gt;
     &lt;xbl:content&gt;
      &lt;Z2/&gt;

     &lt;/xbl:content&gt;
    &lt;/Y&gt;
   &lt;/X&gt;
  &lt;/xbl:template&gt;
 &lt;/xbl:definition&gt;
&lt;/xbl:xbl&gt;</pre>

   <p>The resulting DOM would look like the following. To read these
    diagrams, use the following key:</p>

   <pre>
      |    Solid/dashed lines represent normal DOM traversal attribute
   ---+--- relationships using childNodes, parentNode, nextSibling,
      |    previousSibling, firstChild, lastChild, etc.

      :    Dotted lines represent XBL traversal attribute relationships
   ...:... using xblChildNodes, xblParentNode, xblNextSibling,
      :    xblPreviousSibling, xblFirstChild, xblLastChild, etc.

      )    xblShadowTree
</pre>

   <p>White-space nodes have, for sanity, been left out of these diagrams.</p>

   <p>DOM view:</p>

   <pre>
   |
   +-- A
       |
       +-- B
           |
           +-- C
           |
           +-- D
</pre>

   <p>Clone of the shadow tree for B elements (B.xblShadowTree):</p>

   <pre>
   template
    |
    +-- P
        |
        +-- Q
        |   |
        |   +-- content
        |       |
        |       +-- R
        |
        +-- content
            |
            +-- S
</pre>

   <p>Clone of the shadow tree for Q elements (Q.xblShadowTree):</p>

   <pre>
   template
    |
    +-- X
        |
        +-- Y
            |
            +-- content
            |   |
            |   +-- Z1
            |
            +-- content
                |
                +-- Z2
</pre>

   <p>The xbl traversal for the whole thing:</p>

   <pre>
   :
   :.. A
       :
       :.. B
           :
           :.. P
               :
               :.. Q
               :   :
               :   :.. X
               :       :
               :       :.. Y
               :           :
               :           :.. C
               :           :
               :           :.. Z2
               :
               :.. D

</pre>

   <p>The combined view of the DOM and XBL traversals of the whole thing:</p>

   <pre id="pretty-diagram">
   :|___
   :....A    template
        :|___ )   |
        :... B    |
            :|    |
            :|... P    template
             |   :|____ )    |
             |   :|... Q     |
             |   :|   :|     |
             |   :|   :|.... X
             |   :|    |     :\_______
             |   :|    |     :....... Y __
             |   :|    |              :   \
             |   :|    +-- content*   :    |
             |   :|         |         :    |
             |   :|         +-- R     :    +-- content*
             |   :|                   :    |    |
             +---:|--------- C* ......:    |    `-- Z1
             |   :|                   :    |
             |   :|                   :    `-- content
             |   :|                   :         |___
             |   :|                   :............ Z2
             |   :`-- content#
             |   :     |
             |   :     `-- S
             |___:____
                 :... D# 
</pre>
   <!--
   <p>In this final tree, the dashed lines show the relationships that
   are described by the in <code
   class="dom">xblScopedChildNodes</code> attribute, when those aren't
   the same as the relationships described by the <code
   class="dom">xblChildNodes</code> attribute, which are themselves
   represented by the dotted lines:</p>

<pre>
   :
   :.. A
       :     
       :.. B 
          |: 
          |:.. P 
          |    : 
          |    :.. Q 
          |    :  |:     
          |    :  |:.. X 
          |    :  |    : 
          |    :  |    :.. Y 
          |    :           :
          |____:__|________:__
          |    :  `- - - - : - C
          |    :           :''
          |    :           :
          |    :           :.. Z2
          |____:__    
               :.. D
</pre>
-->
   </div>

  <h3 id="the-event"><span class="secno">6.2. </span>The <code>Event</code>

   Interface</h3>

  <p>Objects that implement the <code class="dom">Event</code> interface must
   also implement the <code class="dom"><a
   href="#originalevent">OriginalEvent</a></code> interface:</p>

  <dl>
   <dt>IDL Definition</dt>

   <dd>
    <pre
     class="idl"> <!-- technically this is invalid OMG IDL but whatever! -->
interface OriginalEvent {
  readonly attribute Event originalEvent;
};
</pre>
   </dd>
  </dl>

  <p>The <dfn id="originalevent"><code class="dom">originalEvent</code></dfn>

   attribute must point to the event that was cloned the last time the event
   was retargetted, if any, and must be null if the event was never
   retargetted. (See: <span><a href="#event7">event flow and targeting across
   shadow scopes</a></span>.)</p>

  <p>If an event is retargetted several times, a chain is formed using this
   attribute, from which script can access each clone of the event, finding
   the original target at each step.</p>

  <h3 id="the-xblshadowtreeelement"><span class="secno">6.3. </span>The <dfn
   id="xblshadowtreeelement0">XBLShadowTreeElement</dfn> Interface</h3>

  <p>The <code class="dom"><a
   href="#xblshadowtreeelement0">XBLShadowTreeElement</a></code> interface is
   implemented by <code><a href="#shadowtree">shadowTree</a></code> elements
   that are in the XBL namespace.</p>

  <dl>
   <dt>IDL Definition</dt>

   <dd>
    <pre class="idl">
interface XBLTemplateElement : Element {
  Element getElementById(in DOMString elementId);
};
</pre>
   </dd>

   <dt>Attributes</dt>

   <dd> None.</dd>

   <dt>Methods</dt>

   <dd>
    <dl>
     <dt><dfn class="method-name" id="getelementbyid"><code
      class="dom">getElementById</code></dfn></dt>

     <dd>
      <p class="note">This method is modelled after the method of the same
       name defined by <a href="#refsDOM3CORE">[DOM3CORE]</a> on the <code
       class="dom">Document</code> interface.</p>

      <p>Returns the <code class="dom">Element</code> that has an ID
       attribute with the given value. If no such element exists, this
       returns <code class="dom">null</code>. If more than one element has an
       ID attribute with that value, what is returned is undefined.</p>

      <p>The method shall only search through the <code><a
       href="#shadowtree">shadowTree</a></code> element and its descendants.</p>

      <p>The DOM implementation is expected to use the attribute <code
       class="dom">Attr.isId</code> to determine if an attribute is of type
       ID.</p>

      <p class="note">Attributes with the name "ID" or "id" are not of type
       ID unless so defined. For example, elements with the name "id" on
       elements that are in the XHTML, SVG and XBL namespaces are defined to
       be of type ID by their respective specifications.</p>

      <dl>
       <dt>Parameters</dt>

       <dd>
        <dl>
         <dt><code class="parameter-name">elementId</code> of type <code
          class="dom">DOMString</code></dt>

         <dd>The unique <code>id</code> value for an element.</dd>

        </dl>
       </dd>

       <dt>Returns</dt>

       <dd>
        <dl>
         <dt><code class="dom">Element</code></dt>

         <dd> The matching element or null if there is none.</dd>
        </dl>
       </dd>

       <dt>No Exceptions</dt>
      </dl>
     </dd>
    </dl>

   </dd>
  </dl>

  <h2 id="Examples"><span class="secno">7. </span>Examples</h2>

  <div class="issue">
   <p>This entire section is new and needs to be reviewed.</p>

   <p>The flowchart example should be close to correct, but it still requires
    careful review.</p>

   <p>The various other RCC examples (GML, XForms, UI) from the last SVG 1.2
    public draft have been copied from the SVG 1.2 draft and placed into this
    document (after modifications to upgrade RCC to sXBL). The examples at
    the end are just as incomplete as they were when they were part of the
    writeup on SVG12/RCC.</p>
  </div>

  <p>This section contains some examples of using sXBL with SVG 1.2.</p>

  <p>In the following example, bindings are used to make three new elements
   act like coloured text blocks.</p>

  <pre class="example">

&lt;svg:svg xmlns:svg="http://www.w3.org/2000/svg" version="1.2"
            xmlns:xbl="http://www.w3.org/2004/xbl"&gt;
  &lt;svg:defs&gt;
   &lt;xbl:xbl&gt;
    &lt;xbl:definition element="red"&gt;
     &lt;xbl:template&gt;
      &lt;svg:text fill="red"&gt;&lt;xbl:content/&gt;&lt;/svg:text&gt;

     &lt;/xbl:template&gt;
    &lt;/xbl:definition&gt;
    &lt;xbl:definition element="green"&gt;
     &lt;xbl:template&gt;
      &lt;svg:text fill="green"&gt;&lt;xbl:content/&gt;&lt;/svg:text&gt;

     &lt;/xbl:template&gt;
    &lt;/xbl:definition&gt;
    &lt;xbl:definition element="blue"&gt;
     &lt;xbl:template&gt;
      &lt;svg:text fill="blue"&gt;&lt;xbl:content/&gt;&lt;/svg:text&gt;

     &lt;/xbl:template&gt;
    &lt;/xbl:definition&gt;
   &lt;/xbl:xbl&gt;
  &lt;/svg:defs&gt;

  &lt;red&gt; Red text. &lt;/red&gt;

  &lt;green&gt; Green text. &lt;/green&gt;
  &lt;blue&gt; Blue text. &lt;/blue&gt;

&lt;/svg:svg&gt;</pre>

  <p>In the following example, an SVG file references a set of custom
   elements for flowcharting from an external file using the <code
   class="element"><a href="#import0">import</a></code> element, and then
   uses the flowcharting custom elements to lay out and render a flowchart:</p>

  <pre class="example">&lt;svg width="12cm" height="3cm"
     xmlns="http://www.w3.org/2000/svg" version="1.2"
     xmlns:xbl="http://www.w3.org/2004/xbl"&gt;
  &lt;desc&gt;Example xbl02 - simple flowchart example using sXBL&lt;/desc&gt;

  &lt;!-- XPointer reference to the location for the flowchart extensions --&gt;
  &lt;xbl:import bindings="xbl02-flowcharts.svg#flowcharts"/&gt;

  &lt;!-- Define elements that use the flowchart extensions. As a result of using
       the extensions, a shadow tree of low-level SVG (circle, rect, path elements)
       is attached  to the 'flowchart' element. The user agent renders the shadow tree. --&gt;
  &lt;flowchart xmlns="http://example.org/flowcharts"
             x="0%" y="0%" width="100%" height="100%"&gt;
    &lt;terminalNode&gt;Start&lt;/terminalNode&gt;
    &lt;processNode&gt;Step 1&lt;/processNode&gt;
    &lt;processNode&gt;Step 2&lt;/processNode&gt;

    &lt;terminalNode&gt;End&lt;/terminalNode&gt;
  &lt;/flowchart&gt;
&lt;/svg&gt;</pre>

  <p><img alt="The result would have a blue circle saying 'Start' from which
   a black arrow exits, pointing at a green rectangle containing the text
   'Step 1', which itself has a similar arrow pointing to 'Step 2', which
   itself again has an arrow, this time pointing to a final blue circle
   saying 'End'." height="114" src="images/examples/xbl02.png" width="454" /></p>

  <p><a href="images/examples/xbl02.svg">View this image as SVG
   (SVG/sXBL-enabled browsers only)</a></p>

  <p> Here is the file which defines the simple flowcharting extensions used
   in the example above:</p>

  <pre
   class="example">&lt;svg xmlns="http://www.w3.org/2000/svg" version="1.2"
     xmlns:xbl="http://www.w3.org/2004/xbl"
     xmlns:ev="http://www.w3.org/2001/xml-events"
     xmlns:flow="http://example.org/flowcharts"&gt;
  &lt;desc&gt;Supplemental file for example xbl02.svg - 
        contains definition of simple flowchart extension elements.&lt;/desc&gt;

  &lt;xbl:xbl id="flowcharts"&gt;

    &lt;!-- Example needs to be upgraded to show handling of mutation events --&gt;

    &lt;defs&gt;
      &lt;symbol id="connectorline"&gt;
        &lt;path transform="translate(0 50)" stroke="black" stroke-width="3" fill="black"
              d="M 0,0 L 90,0 L 90,-10 L 100,0 L 90,10 L 90,0"/&gt;
      &lt;/symbol&gt;

    &lt;/defs&gt;

    &lt;xbl:definition element="flow:terminalNode"&gt;
      &lt;xbl:template&gt;
        &lt;g&gt;
          &lt;circle stroke="#008" stroke-width="5" fill="none" cx="50" cy="50" r="50"/&gt;
          &lt;text x="50" y="57" font-size="25" text-anchor="middle"&gt;&lt;xbl:content/&gt;&lt;/text&gt;

        &lt;/g&gt;
      &lt;/xbl:template&gt;
    &lt;/xbl:definition&gt;

    &lt;xbl:definition name="flow:processNode"&gt;
      &lt;xbl:template&gt;
        &lt;g&gt;

          &lt;rect stroke="#080" stroke-width="5" fill="none" width="150" height="100" rx="10"/&gt;
          &lt;text x="75" y="57" font-size="25" text-anchor="middle"&gt;&lt;xbl:content/&gt;&lt;/text&gt;
        &lt;/g&gt;
      &lt;/xbl:template&gt;
    &lt;/xbl:definition&gt;

    &lt;xbl:definition name="flow:flowchart"&gt;
      &lt;!-- For this example, set up template with no extra whitespace to
           simplify the sample ECMAScript. --&gt;
      &lt;xbl:template&gt;&lt;svg&gt;&lt;xbl:content/&gt;&lt;/svg&gt;&lt;/xbl:template&gt;
      &lt;xbl:handlerGroup&gt;

        &lt;!-- Note: using the 'svg:handler' element that is new with SVG 1.2 --&gt;
        &lt;handler ev:event="xbl:bound" type="text/ecmascript"&gt;&lt;![CDATA[
          var svgns = "http://www.w3.org/2000/svg";
          var xlinkns = "http://www.w3.org/1999/xlink";
          var flowchartns = "http://example.org/flowcharts";
          var ELEMENT_NODE = 1;
          var SIDE_INDENT = 50;
          var PROCESSNODE_WIDTH = 150;
          var TERMINALNODE_WIDTH = 100;
          var CONNECTOR_WIDTH = 100;
          var YPOS = 50;
          var flowchartelement = evt.target;
          var templateElement = flowchartelement.xblShadowTree;
          var svgElm = templateElement.firstChild;
          svgElm.setAttributeNS(null, "x", flowchartelement.getAttributeNS(null, "x"));
          svgElm.setAttributeNS(null, "y", flowchartelement.getAttributeNS(null, "y"));
          svgElm.setAttributeNS(null, "width", flowchartelement.getAttributeNS(null, "width"));
          svgElm.setAttributeNS(null, "height", flowchartelement.getAttributeNS(null, "height"));

          // Determine total width needed and set viewBox attribute appropriately.
          var totalWidth = 0;
          var nodeCount = 0;
          for( var node = flowchartelement.firstChild ; node != null ; node = node.nextSibling )
          {
            // only process elements in flowchart ns
            if( node.nodeType == ELEMENT_NODE &amp;&amp; node.namespaceURI == flowchartns) {
              nodeCount++;
              if (node.localName == "processNode")
                totalWidth += PROCESSNODE_WIDTH;
              else if (node.localName == "terminalNode")
                totalWidth += TERMINALNODE_WIDTH;
            }
          }
          totalWidth += (nodeCount-1)*CONNECTOR_WIDTH + 2*SIDE_INDENT;
          svgElm.setAttributeNS(null, "viewBox", "0 0 "+totalWidth+" 200");
          var xtrans = 50;

          // Position all of the nodes and draw the connectors.
          var xpos = SIDE_INDENT;
          var nodeNum = 0;
          for( var node = flowchartelement.firstChild ; node != null ; node = node.nextSibling )
          {
            // only process elements in flowchart ns
            if( node.nodeType == ELEMENT_NODE &amp;&amp; node.namespaceURI == flowchartns) {
              node.xblShadowTree.setAttributeNS(null, "transform", "translate("+xpos+" "+YPOS+")");
              var nodeWidth;
              if (node.localName == "processNode") {
                nodeWidth = PROCESSNODE_WIDTH;
              } else if (node.localName == "terminalNode") {
                nodeWidth = TERMINALNODE_WIDTH;
              }
              xpos += nodeWidth;
              // Add connector line to end of flowchart node's shadowTree.
              if (nodeNum &lt; (nodeCount-1)) {
                var useElement = document.createElementNS(svgns, "use");
                useElement.setAttributeNS(xlinkns, "xlink:href", "#connectorline");
                useElement.setAttributeNS(null, "transform", "translate("+nodeWidth+" 0)");
                node.xblShadowTree.appendChild(useElement);
                xpos += CONNECTOR_WIDTH;
              }
              nodeNum++;
            }
          }
        ]]&gt;&lt;/handler&gt;
      &lt;/xbl:handlerGroup&gt;

    &lt;/xbl:definition&gt;

  &lt;/xbl:xbl&gt;

&lt;/svg&gt;</pre>

  <p>The next example takes sample code from section 4.6 from the <a
   href="http://www.opengis.net/">Geography Markup Language (GML)
   specification</a>, version 2.1.2. The 'extensionDefs' element would effect
   a client-side transformation from original XML/GML into final-form SVG
   rendering.</p>

  <pre class="example">
&lt;svg width="12cm" height="3cm"
     xmlns="http://www.w3.org/2000/svg" version="1.2"
     xmlns:xbl="http://www.w3.org/2004/xbl"&gt;
  &lt;desc&gt;Example xbl-gml-01 - GML and XBL&lt;/desc&gt;

  &lt;!-- XPointer reference to the location for the GML extensions --&gt;
  &lt;xbl:import bindings="xbl-gml-01-exts.svg#gml"/&gt;

  &lt;CityModel xmlns="http://www.opengis.net/examples"
             xmlns:gml="http://www.opengis.net/gml"
             xmlns:xlink="http://www.w3.org/1999/xlink"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.opengis.net/examples city.xsd"&gt;

    &lt;gml:name&gt;Cambridge&lt;/gml:name&gt;
    &lt;gml:boundedBy&gt;
      &lt;gml:Box srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"&gt;
        &lt;gml:coord&gt;&lt;gml:X&gt;0.0&lt;/gml:X&gt;&lt;gml:Y&gt;0.0&lt;/gml:Y&gt;&lt;/gml:coord&gt;

        &lt;gml:coord&gt;&lt;gml:X&gt;100.0&lt;/gml:X&gt;&lt;gml:Y&gt;100.0&lt;/gml:Y&gt;&lt;/gml:coord&gt;
      &lt;/gml:Box&gt;
    &lt;/gml:boundedBy&gt;

    &lt;cityMember&gt;
      &lt;River&gt;
        &lt;gml:description&gt;The river that runs through Cambridge.&lt;/gml:description&gt;
        &lt;gml:name&gt;Cam&lt;/gml:name&gt;
        &lt;gml:centerLineOf&gt;

          &lt;gml:LineString srsName="http://www.opengis.net/gml/srs/epsg.xml#4326"&gt;
            &lt;gml:coord&gt;&lt;gml:X&gt;0&lt;/gml:X&gt;&lt;gml:Y&gt;50&lt;/gml:Y&gt;&lt;/gml:coord&gt;
            &lt;gml:coord&gt;&lt;gml:X&gt;70&lt;/gml:X&gt;&lt;gml:Y&gt;60&lt;/gml:Y&gt;&lt;/gml:coord&gt;

            &lt;gml:coord&gt;&lt;gml:X&gt;100&lt;/gml:X&gt;&lt;gml:Y&gt;50&lt;/gml:Y&gt;&lt;/gml:coord&gt;
          &lt;/gml:LineString&gt;
        &lt;/gml:centerLineOf&gt;
      &lt;/River&gt;

    &lt;/cityMember&gt;

    &lt;dateCreated&gt;2000-11&lt;/dateCreated&gt;
  &lt;/CityModel&gt;
    &lt;/svg&gt; </pre>

  <p>The next example takes sample code from [Appendix G of the XForms
   specification | http://www.w3.org/TR/xforms/sliceG.html ] . The <code
   class="element">extensionDefs</code> element would effect a client-side
   transformation from original XForms elements into final-form SVG
   rendering. In this example, the assumption is that the extension would
   implement all or at least a large part of the XForms specification via
   DOM/scripting.</p>

  <pre class="example">
&lt;svg width="12cm" height="3cm"
     xmlns="http://www.w3.org/2000/svg" version="1.2"
     xmlns:xforms="http://www.w3.org/2002/xforms"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
     xmlns:ev="http://www.w3.org/2001/xml-events"
     xmlns:xbl="http://www.w3.org/2004/xbl"
     xmlns:my="http://commerce.example.com/payment"&gt;
  &lt;desc&gt;Example xbl-xforms-01 - using sXBL within a combined XForms+SVG user agent&lt;/desc&gt;
  &lt;title xml:lang="fr"&gt;XForms en SVG&lt;/title&gt;

  &lt;!-- XPointer reference to the location for the XForms extensions to SVG.
       The extensions convert the XForms UI elements into low-level SVG
       interactive graphics and also provide  high-level features,
       such as client-side validation and the XForms event model. --&gt;
  &lt;xbl:import bindings="xbl-xforms-01-exts.svg#xforms"/&gt;

  &lt;rx:renderXForms xmlns:rx="http://example.org/rcc-xforms"
         xmlns="http://www.w3.org/2002/xforms"&gt;

    &lt;model schema="payschema.xsd"&gt;
      &lt;instance&gt;

        &lt;my:payment as="credit"&gt;
          &lt;my:cc /&gt;
          &lt;my:exp /&gt;
        &lt;/my:payment&gt;
      &lt;/instance&gt;
      &lt;submission action="http://www.example.com/buy.rb" method="post" id="s00" /&gt;

      &lt;bind nodeset="my:cc" relevant="../@as='credit'" required="true()" /&gt;
      &lt;bind nodeset="my:exp" relevant="../@as='credit'" required="true()" /&gt;
    &lt;/model&gt;

    &lt;group xmlns="http://www.w3.org/2002/xforms"&gt;
      &lt;trigger&gt;
        &lt;label&gt;Fran&ccedil;ais&lt;/label&gt;

        &lt;toggle case="fr" ev:event="xforms-activate" /&gt;
      &lt;/trigger&gt;
      &lt;trigger&gt;
        &lt;label&gt;English&lt;/label&gt;
        &lt;toggle case="en" ev:event="xforms-activate" /&gt;

      &lt;/trigger&gt;
    &lt;/group&gt;

    &lt;input ref="my:cc"&gt;
      &lt;label xml:lang="fr"&gt;Num&eacute;ro de carte bancaire&lt;/label&gt;
      &lt;alert xml:lang="fr"&gt;Saisissez un num&eacute;ro de carte
       bancaire valide en s&eacute;parant chaque groupe de chiffres
       d'un espace ou d'un trait d'union.&lt;/alert&gt;

    &lt;/input&gt;

    &lt;input ref="my:exp"&gt;
      &lt;label xml:lang="fr"&gt;Date d'&eacute;ch&eacute;ance&lt;/label&gt;
    &lt;/input&gt;

    &lt;submit submission="s00"&gt;
      &lt;label xml:lang="fr"&gt;Achetez&lt;/label&gt;
    &lt;/submit&gt;
&lt;/svg&gt; </pre>

  <p> The next example supplements the XForms example above with the
   following simple example which shows a set of extension elements <code
   class="element">ui:menubar</code>, <code class="element">ui:menu</code>,
   <code class="element">ui:menuitem</code>) which present a menubar and a
   scrolling area for graphics.</p>

  <pre class="example">
&lt;svg width="525" height="575"
     xmlns="http://www.w3.org/2000/svg" version="1.2"
     xmlns:ui="http://example.org/xbl-ui"&gt;
  &lt;desc&gt;Example xbl-ui-01 - using XBL for UI elements&lt;/desc&gt;
  &lt;title&gt;UI in SVG&lt;/title&gt;

  &lt;!-- XPointer reference to the location for the UI extensions to SVG.
       The extensions convert the UI elements into low-level SVG. --&gt;

  &lt;xbl:import bindings="xbl-ui-01-exts.svg#ui"/&gt;

  &lt;ui:menubar x="25" y="25" width="500" height="20" font-size="14"&gt;
    &lt;ui:menu title=File&gt;
      &lt;ui:menuitem title=New op="newdoc(evt)"&gt;
      &lt;ui:menuitem title=Open op="opendoc(evt)"&gt;
    &lt;/ui:menu&gt;

    &lt;ui:menu title=Edit&gt;
      &lt;ui:menuitem title=Copy op="copy(evt)"&gt;
      &lt;ui:menuitem title=Past op="paste(evt)"&gt;
    &lt;/ui:menu&gt;
  &lt;/ui:menubar&gt;

  &lt;ui:scrollArea x="25" y="50" width="500" height="400"&gt;

    &lt;image xlink:href="..." ... /&gt;
    &lt;path d="..." ... /&gt;
    &lt;text transform="..." font-size="..."&gt;...&lt;/text&gt;
  &lt;/ui:scrollArea&gt;
&lt;/svg&gt; </pre>

  <p> The last example shows XBL being used for custom container elements
   that perform layout, in this case a magazine layout.</p>

  <pre class="example">
&lt;svg&gt;
  ...

  &lt;!-- XPointer reference to the location for the widgets extensions to SVG.
       The extensions convert the widget elements into low-level SVG. --&gt;
  &lt;xbl:import bindings="xbl-dynlayout-01-exts.svg#dynlayout" /&gt;

  &lt;foo:DynamicPageLayout&gt;
    &lt;foo:articles&gt;
      &lt;foo:article&gt;
        &lt;foo:title&gt;Major war erupts&lt;/foo:title&gt;
        &lt;foo:para&gt;War broke out around the world today...&lt;/foo:para&gt;

      &lt;/foo:article&gt;
      &lt;foo:article&gt;
        &lt;foo:title&gt;Two headed-chicken born&lt;/foo:title&gt;
        &lt;foo:para&gt;The sleepy town of Frostbite Falls is excited about...&lt;/foo:para&gt;
      &lt;/foo:article&gt;

    &lt;/foo:articles&gt;
  &lt;/foo:DynamicPageLayout&gt;
  ...
&lt;/svg&gt; </pre>

  <h2 id="grammar"><span class="secno">8. </span>Grammar</h2>

  <div class="issue">This grammar is not necessarily completely up to date.</div>

  <p>The following defines the grammar for sXBL using <a
   href="http://www.oasis-open.org/committees/relax-ng/spec-20011203.html">RelaxNG</a>.</p>

  <pre class="schema">
&lt;!-- ==============================================================
      sXBL 1.0 ~ simplied schema
      Robin Berjon &lt;robin.berjon@expway.fr&gt;
      31/05/2004
     ============================================================== --&gt;

&lt;grammar ns='http://www.w3.org/2004/xbl'
         xml:lang='en'
         xmlns='http://relaxng.org/ns/structure/1.0'
         xmlns:a='http://relaxng.org/ns/compatibility/annotations/1.0'
         datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'
         &gt;
  &lt;!--
    NOTES:
        - this is a simplified schema in that it does not define classes and 
          other such constructs that would make it easier to integrate into the
          rest of the SVG schema
        - I seem to remember there was a bug in my RNG namespace wildcards. If 
          so, it has been copied here (I have no reference handy).
        - I have followed the descriptions in the spec, so that if it says "zero
          or more foo" and then "zero or more bar", then the foos must occur 
          before the bars. This can be changed.
        - there are some spec issues embedded in the comments
  --&gt;

  &lt;!-- ... common definitions .............................................. --&gt;
  &lt;define name='id.attrib'&gt;
    &lt;optional&gt;
      &lt;attribute name='id'&gt;

        &lt;data type='ID'/&gt;
      &lt;/attribute&gt;
    &lt;/optional&gt;
  &lt;/define&gt;

  &lt;!-- ... elements ........................................................ --&gt;
  &lt;element name='xbl'&gt;

    &lt;zeroOrMore&gt;&lt;ref name='definition'/&gt;&lt;/zeroOrMore&gt;
    &lt;zeroOrMore&gt;&lt;ref name='import'/&gt;&lt;/zeroOrMore&gt;
    &lt;ref name='id.attrib'/&gt;
  &lt;/element&gt;

  &lt;element name='definition'&gt;
    &lt;choice&gt;
      &lt;attribute name='ref'&gt;&lt;data type='anyURI'/&gt;&lt;/attribute&gt;
      &lt;group&gt;
        &lt;optional&gt;&lt;ref name='template'/&gt;&lt;/optional&gt;

        &lt;optional&gt;&lt;ref name='handlerGroup'/&gt;&lt;/optional&gt;
        &lt;attribute name='element'&gt;&lt;data type='QName'/&gt;&lt;/attribute&gt;
      &lt;/group&gt;
    &lt;/choice&gt;
    &lt;ref name='id.attrib'/&gt;

  &lt;/element&gt;
    
  &lt;element name='template'&gt;
    &lt;ref name='id.attrib'/&gt;
  &lt;/element&gt;

  &lt;element name='content'&gt;
    &lt;optional&gt;&lt;attribute name='includes'&gt;&lt;text/&gt;&lt;/attribute&gt;&lt;/optional&gt;

    &lt;ref name='id.attrib'/&gt;
  &lt;/element&gt;
    
  &lt;element name='handlerGroup'&gt;
    &lt;!-- the content model for this element mentions ev:listener and svg:handler
         but is rather unclear as to what should be included here --&gt;
    &lt;ref name='id.attrib'/&gt;
  &lt;/element&gt;

  &lt;element name='import'&gt;
    &lt;!-- this should really be either of xlink:href or src --&gt;
    &lt;optional&gt;&lt;attribute name='bindings'&gt;&lt;data type='anyURI'/&gt;&lt;/attribute&gt;&lt;/optional&gt;
    &lt;ref name='id.attrib'/&gt;

  &lt;/element&gt;
&lt;/grammar&gt;
</pre>

  <h2 id="RCCComparison"><span class="secno">9. </span>Comparison of sXBL to
   RCC</h2>

  <p class="note">This section will be removed before the Last &#x43;all
   draft of the sXBL specification.</p>

  <p>With this first public draft of sXBL, the SVG 1.2 feature formerly known
   as RCC (Rendering Custom Content:
   http://www.w3.org/TR/2004/WD-SVG12-20040510/#rcc) has been factored out
   into its own reusable namespace and reconciled to be forward-looking for
   use by other XBL grammars.</p>

  <p>The following table provides a quick summary comparison of how sXBL
   compares with the RCC (Rendering Custom Content) feature found in earlier
   drafts of SVG 1.2:</p>

  <table summary="Comparison sXBL to RCC">
   <thead>
    <tr>
     <td>RCC</td>

     <td>sXBL</td>
    </tr>
   </thead>

   <tbody>
    <tr>
     <td>
      <p><code>&lt;svg:extensionDefs
       xlink:href="<em>xpointer</em>"</code>/&gt;</p>

      <p>In RCC, the svg:extensionDefs element could use an <em>xpointer</em>
       to reference the binding definitions. If so, the <em>xpointer</em> had
       to point to a different svg:extensionDefs element, typically in a
       separate file.</p>
     </td>

     <td>
      <p><code>&lt;xbl:import bindings="<em>xpointer</em>"/&gt;</code></p>

      <p>To accomplish the same functionality in sXBL, use the xbl:import
       element. In sXBL, there is more flexibility. The <em>xpointer</em> can
       point to either an xbl:xbl element, typically in a separate file, or
       to an SVG file which can contain any number of xbl:xbl elements, all
       of which get processed.</p>
     </td>
    </tr>

    <tr>
     <td>
      <p><code>&lt;svg:extensionDefs namespace="<em>nsURI</em>"&gt;<br />

       &nbsp;&nbsp;...definitions of custom elements...<br />
       &lt;/svg:extensionDefs&gt;</code></p>

      <p>In RCC, the 'namespace' attribute applied to all svg:elementDef
       children of the svg:extensionDefs element.</p>
     </td>

     <td>
      <p><code>&lt;xbl:xbl&gt;<br />

       &nbsp;&nbsp;...definitions of custom elements...<br />
       &lt;/xbl:xbl&gt;</code></p>

      <p>In sXBL, the 'namespace' attribute is no longer needed. The
       'element' attribute on the xbl:definition element takes a QName. The
       namespace prefix on the QName identifies the namespace for the custom
       element.</p>
     </td>
    </tr>

    <tr>

     <td>
      <p><code>&lt;svg:elementDef name="<em>localname</em>"&gt;<br />
       &nbsp;&nbsp;...binding definition...<br />
       &lt;/svg:elementDef&gt;</code></p>

      <p>In RCC, the 'name' attribute provided the localname of the custom
       element. The namespace for the custom element came from the
       'namespace' attribute on the svg:extensionDefs element.</p>

     </td>

     <td>
      <p><code>&lt;xbl:definition element="<em>QName</em>"&gt;<br />
       &nbsp;&nbsp;...binding definition...<br />
       &lt;/xbl:definition&gt;</code></p>

      <p>In sXBL, the 'element' attribute identifies the custom element by a
       QName. The namespace prefix on the QName identifies the namespace for
       the custom element. The localname part of the QName completes the
       identification of the custom element.</p>
     </td>
    </tr>

    <tr>
     <td>
      <p><em>N/A in RCC</em></p>
     </td>

     <td>
      <p><code>&lt;xbl:definition element="<em>QName</em>"
       ref="<em>xpointer</em>"/&gt;</code></p>

      <p>In sXBL, it is possible to have the bound document associate custom
       elements with per-element bindings using the xbl:definition element
       with a 'ref' attribute. This allows the bound document (i.e., the
       document which contains the custom elements) to dictate how to
       associate its custom elements with the binding definitions (i.e.,
       xbl:definition elements) found in another document.</p>
     </td>
    </tr>

    <tr>
     <td>
      <p><code>&lt;svg:defs&gt;, &lt;svg:script&gt;,
       &lt;svg:handler&gt;</code></p>

      <p>In RCC, svg:defs, svg:script, and svg:handler could appear in
       various locations within RCC definitions.</p>
     </td>

     <td>
      <p><code>&lt;svg:defs&gt;, &lt;svg:script&gt;,
       &lt;svg:handler&gt;</code></p>

      <p>In general, sXBL has the same rules. One addition with sXBL is the
       xbl:handlerGroup element, described below.</p>
     </td>
    </tr>

    <tr>
     <td>
      <p><code>&lt;svg:prototype <em>various attributes</em>&gt;<br />
       &nbsp;&nbsp;...initial shadow tree...<br />
       &lt;/svg:prototype&gt;</code></p>

      <p>In RCC, the svg:prototype contained an initial template for the
       elements which were cloned into the shadow tree for the custom
       element. The svg:prototype element was the root node of the set of
       elements which were rendered and received events. Because
       svg:prototype was part of the rendering and event pipelines, you were
       able to attach styling properties, transforms, and event attributes
       (the <em>various attributes</em> listed above) to the svg:prototype
       element.</p>

     </td>

     <td>
      <p><code>&lt;xbl:template&gt;<br />
       &nbsp;&nbsp;...initial shadow tree...<br />
       &lt;/xbl:template&gt;</code></p>

      <p>sXBL is nearly the same. Just like svg:prototype, xbl:template
       contained an initial template for the elements which are cloned into
       the shadow tree for the custom element. xbl:template is the root node
       of the xblShadowTree, in much the same way that svg:prototype element
       was the root node of the shadow tree. However, one distinction is that
       for rendering the xbl:template is flattened out of the rendering
       pipeline. Therefore, it is not possible to attach styling properties,
       transforms, and event attributes to an xbl:template; instead, you need
       to include a container element such as an &lt;svg:g&gt; element in the
       shadow tree if you need to attach styling properties, transforms, and
       event attributes.</p>

     </td>
    </tr>

    <tr>
     <td>
      <p><code>&lt;svg:transformer&gt;, &lt;svg:param&gt;</code></p>

      <p>The latest public draft of RCC described these two elements
       (http://www.w3.org/TR/2004/WD-SVG12-20040510/#transformer-element),
       but warned the community that there features are "...likely to be
       removed from the next draft of SVG 1.2, due to the high burden on
       implementation and the difficulty in optimization."</p>

     </td>

     <td>
      <p><em>Not available</em></p>

      <p>In the transition from RCC to sXBL, &lt;svg:transformer&gt;,
       &lt;svg:param&gt; have been removed.</p>

     </td>
    </tr>

    <tr>
     <td>
      <p><code>&lt;svg:refContent [select="<em>xpath</em>"] <em>various
       attributes</em>/&gt;</code></p>

      <p>In RCC, the svg:refContent allowed the shadow content to
       include-by-reference child elements of the custom element. The
       svg:refContent element was a container node for the referenced
       elements and was part of the rendering and event pipelines. Because
       svg:refContent was part of the rendering and event pipelines, you were
       able to attach styling properties, transforms, and event attributes
       (the <em>various attributes</em> listed above) to the svg:refContent
       element.</p>
     </td>

     <td>
      <p><code>&lt;xbl:content [includes="<em>???</em>"]&gt;<br />
       &nbsp;&nbsp;...backup content...<br />

       &lt;/xbl:xbl:content&gt;</code></p>

      <p>The most important aspects of sXBL are the same. Just like
       svg:prototype, xbl:content does an include-by-reference to the child
       elements of the custom element. The exact name of the attribute (e.g.,
       'select' versus 'includes' is still under debate and the syntax of
       this attribute (xpath? tagnames? CSS selector syntax?) is also still
       under debate. The rules for what happens if there is a mismatch
       between the bound element's content and the set of xbl:content
       elements is also under debate. Finally, sXBL might include a backup
       content feature that was not available in RCC.</p>

      <p>One distinction with sXBL is that the xbl:content is flattened out
       of the rendering pipeline. Therefore, it is not possible to attach
       styling properties, transforms, and event attributes to an
       xbl:content; instead, you need to include a parent container element
       such as an &lt;svg:g&gt; element in the shadow tree if you need to
       attach styling properties, transforms, and event attributes.</p>
     </td>
    </tr>

    <tr>
     <td>
      <p><code>&lt;svg:traitDef&gt;</code></p>

      <p>In RCC, told the user agent about custom attributes to enable
       animation of custom attributes and attachment of mutation event
       listeners.</p>
     </td>

     <td>

      <p><em>Moved out of RCC into SVG 1.2.</em></p>

      <p>These features will be defined within the SVG 1.2 specification and
       will not be part of the sXBL specification.</p>
     </td>
    </tr>

    <tr>
     <td>
      <p><code>SVGBindBegin, SVGBindEnd</code></p>

      <p>In RCC, the SVGBindBegin event was raised just after cloning the
       svg:prototype but before recursively applying RCC bindings to the
       contents of the shadow tree. The SVGBindEnd event is raised after
       recursively applying RCC bindings to the elements which were cloned
       onto the shadow tree.</p>
     </td>

     <td>
      <p><code>xbl:prebind, xbl:bound, xbl:unbinding</code></p>

      <p>In sXBL, the binding events are in the XBL namespace
       (http://www.w3.org/2004/xbl). xbl:prebind matches SVGBindBegin, and
       xbl:bound matches SVGBindEnd. sXBL adds an xbl:unbinding event so that
       script can be told when a binding is about to be unattached from a
       custom element.</p>
     </td>

    </tr>

    <tr>
     <td>
      <p><em>RCC detailed processing model</em></p>

      <p>The SVG 1.2 drafts were incomplete in various ways in describing the
       complete details of the RCC processing model. Some aspects were
       well-specified. Other aspects were designed but had not been committed
       to the public specifications yet. Some aspects of the processing model
       were not yet resolved.</p>
     </td>

     <td>
      <p><em>sXBL detailed processing model</em></p>

      <p>The sXBL specification is still under development. In general, the
       detailed processing model for sXBL is highly consistent with the
       detailed processing model for the parts of RCC that were described in
       early SVG 1.2 drafts. Some aspects of the sXBL processing model are
       still under discussion.</p>
     </td>
    </tr>
   </tbody>
  </table>

  <h2 id="XBLComparison"><span class="secno">10. </span> Comparison of sXBL
   to XBL1</h2>

  <div class="issue"><!-- @@XXX -->
   <p>Nigel McFarlane has kindly offered to write an appendix describing the
    differences between Mozilla's XBL and the sXBL language defined by this
    specification.</p>
  </div>

  <h2 class="no-num" id="acknowledgments">Acknowledgments</h2>

  <p>The membership of the XBL task force was drawn from the SVG and CSS
   working groups, and consisted of L. David Baron, Robin Berjon, Alex
   Danilo, Jon Ferraiolo, Darryl Fuller, Ian Hickson, David Hyatt, Dean
   Jackson, Christophe Jolif, Chris Lilley, Antoine Quint, Peter Sorotokin.</p>

  <h2 class="no-num" id="references">References</h2>

  <dl>
   <dt class="normref" id="refsCSS3UI"><strong>[CSS3UI]</strong></dt>

   <dd>"CSS3 Basic User Interface Module", T. Çelik, editor, 11 May 2004.
    Available at <a
    href="http://www.w3.org/TR/css3-ui">http://www.w3.org/TR/css3-ui</a>.</dd>

   <dt class="normref" id="refsDOM3CORE"><strong>[DOM3CORE]</strong></dt>

   <dd>"Document Object Model (DOM) Level 3 Core Specification", A. Le Hors,
    P. Le Hégaret <i>et. al.</i>, editors, 07 April 2004. Available at <a
    href="http://www.w3.org/TR/DOM-Level-3-Core">http://www.w3.org/TR/DOM-Level-3-Core</a>.</dd>

   <dt class="normref" id="refsDOM3EVENTS"><strong>[DOM3EVENTS]</strong></dt>

   <dd>"Document Object Model (DOM) Level 3 Events Specification", P. Le
    Hégaret, T. Pixley, editors, 07 November 2003. Available at <a
    href="http://www.w3.org/TR/DOM-Level-3-Events">http://www.w3.org/TR/DOM-Level-3-Events</a>.</dd>

   <dt class="normref" id="refsRFC2119"><strong>[RFC2119]</strong></dt>

   <dd>"Key words for use in RFCs to Indicate Requirement Levels", S.
    Bradner, March 1997. Available at <a
    href="http://www.ietf.org/rfc/rfc2119.txt">http://www.ietf.org/rfc/rfc2119.txt</a>.</dd>

   <dt class="normref" id="refsSVG"><strong>[SVG11]</strong></dt>

   <dd>"Scalable Vector Graphics (SVG) 1.1 Specification", J. Ferraiolo,
    &#34276;&#27810; &#28147;, D. Jackson, editors, 14 January 2003.
    Available at <a
    href="http://www.w3.org/TR/SVG11/">http://www.w3.org/TR/SVG11/</a>.</dd>

   <dt class="normref" id="refsXML"><strong>[XML10]</strong></dt>

   <dd>"Extensible Markup Language (XML) 1.0 (Third Edition)", T. Bray, J.
    Paoli, C.M. Sperberg-McQueen, E. Maler, F. Yergeau editors, 04 February
    2004. Available at <a
    href="http://www.w3.org/TR/REC-xml">http://www.w3.org/TR/REC-xml</a>.</dd>

   <dt class="normref" id="refsXMLBASE"><strong>[XMLBASE]</strong></dt>

   <dd>"XML Base", J. Marsh , editor, 20 December 2000. Available at <a
    href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>.</dd>

   <dt class="normref" id="refsXMLNS"><strong>[XMLNS]</strong></dt>

   <dd>"Namespaces in XML", T. Bray, D. Hollander, A. Layman, editors, 14
    January 1999. Available at <a
    href="http://www.w3.org/TR/REC-xml-names/">http://www.w3.org/TR/REC-xml-names/</a>.</dd>

  </dl>
 </body>
</html>