index.html
539 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
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="EN">
<head>
<meta name="generator" content="HTML Tidy, see www.w3.org" />
<title>Voice Extensible Markup Language (VoiceXML) 3.0</title>
<style type="text/css">
code { font-family: monospace; }
div.constraint,
div.issue,
div.note,
div.notice { margin-left: 2em; }
ol.enumar { list-style-type: decimal; }
ol.enumla { list-style-type: lower-alpha; }
ol.enumlr { list-style-type: lower-roman; }
ol.enumua { list-style-type: upper-alpha; }
ol.enumur { list-style-type: upper-roman; }
div.exampleInner pre { margin-left: 1em;
margin-top: 0em; margin-bottom: 0em}
div.exampleOuter {border: 4px double gray;
margin: 0em; padding: 0em}
div.exampleInner { background-color: #d5dee3;
border-top-width: 4px;
border-top-style: double;
border-top-color: #d3d3d3;
border-bottom-width: 4px;
border-bottom-style: double;
border-bottom-color: #d3d3d3;
padding: 4px; margin: 0em }
div.exampleWrapper { margin: 4px }
div.exampleHeader { font-weight: bold;
margin: 4px}
table {
width:80%;
border:1px solid #000;
border-collapse:collapse;
font-size:90%;
}
td,th{
border:1px solid #000;
border-collapse:collapse;
padding:5px;
}
caption{
background:#ccc;
font-size:140%;
border:1px solid #000;
border-bottom:none;
padding:5px;
text-align:center;
}
img.center {
display: block;
margin-left: auto;
margin-right: auto;
}
p.caption {
text-align: center
}
</style>
<link rel="stylesheet" type="text/css"
href="http://www.w3.org/StyleSheets/TR/W3C-WD.css" />
</head>
<body>
<div class="head">
<p><a href="http://www.w3.org/"><img
src="http://www.w3.org/Icons/w3c_home" alt="W3C" height="48"
width="72" /></a></p>
<h1><a name="title" id="title" />Voice Extensible Markup Language
(VoiceXML) 3.0</h1>
<h2><a name="w3c-doctype" id="w3c-doctype" />W3C Working Draft
<i>16</i> <i>December</i> <i>2010</i></h2>
<dl>
<dt>This version:</dt>
<dd><a
href="http://www.w3.org/TR/2010/WD-voicexml30-20101216/">http://www.w3.org/TR/2010/WD-voicexml30-20101216/</a></dd>
<dt>Latest version:</dt>
<dd><a
href="http://www.w3.org/TR/voicexml30/">http://www.w3.org/TR/voicexml30/</a></dd>
<dt>Previous version:</dt>
<dd><a
href="http://www.w3.org/TR/2010/WD-voicexml30-20100831/">http://www.w3.org/TR/2010/WD-voicexml30-20100831/</a></dd>
<dt>Editors:</dt>
<dd>Scott McGlashan, Hewlett-Packard (co-Editor-in-Chief)</dd>
<dd>Daniel C. Burnett, Voxeo (co-Editor-in-Chief)</dd>
<dd>Rahul Akolkar, IBM</dd>
<dd>RJ Auburn, Voxeo</dd>
<dd>Paolo Baggia, Loquendo</dd>
<dd>Jim Barnett, Genesys Telecommunications Laboratories</dd>
<dd>Michael Bodell, Microsoft</dd>
<dd>Jerry Carter, Nuance</dd>
<dd>Mangesh Deshmukh, Alcatel-Lucent</dd>
<dd>Matt Oshry, Microsoft</dd>
<dd>Kenneth Rehor, Cisco</dd>
<dd>Xu Yang, Aspect</dd>
<dd>Milan Young, Nuance</dd>
<dd>Rafah Hosn (until 2008, when at IBM)</dd>
</dl>
<p class="copyright"><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a>
© 2010 <a href="http://www.w3.org/"><acronym
title="World Wide Web Consortium">W3C</acronym></a><sup>®</sup> (<a
href="http://www.csail.mit.edu/"><acronym
title="Massachusetts Institute of Technology">MIT</acronym></a>, <a
href="http://www.ercim.eu/"><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>
</div>
<hr />
<div>
<h2><a name="abstract" id="abstract" />Abstract</h2>
<p>This document specifies VoiceXML 3.0, a modular XML language for
creating interactive media dialogs that feature synthesized speech,
recognition of spoken and DTMF key input, telephony, mixed
initiative conversations, and recording and presentation of a
variety of media formats including digitized audio, and digitized
video.</p>
<p>Its major goal is to bring the advantages of Web-based
development and content delivery to interactive voice response
applications.</p>
</div>
<div>
<h2><a name="status" 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 is the 16 December 2010 Eighth Public Working Draft of
"Voice Extensible Markup Language (VoiceXML) 3.0". The main
differences from the previous draft are described in Appendix <a
href="#Changes"><b>F Major changes since the last Working
Draft</b></a>. A <a href="diff.html">diff-marked version</a> of
this document is also available for comparison purposes.</p>
<p>This document is very much a work in progress. Many sections are
incomplete, only stubbed out, or missing entirely. To get early
feedback, the group focused on defining enough functionality,
modules, and profiles to demonstrate the general framework. To
complete the specification, the group expects to introduce
additional functionality (for example speaker identification and
verification, external eventing) and describe the existing
functionality at the level of detail given for the Prompt and Field
modules. We explicitly request feedback on the framework,
particularly any concerns about its implementability or suitability
for expected applications. By early 2011 the group expects all key
capabilities to be present in the specification, with details
worked out by late 2011.</p>
<p>Applications written as 2.1 documents can be used under a 3.0
processor using the 2.1 profile. As an example, the Implementation
Report tests for 2.1 (which includes the IR tests for 2.0) will be
supported on a 3.0 processor. Exceptions will be clarifications and
changes needed to improve interoperability.</p>
<p>This document is a <a
href="http://www.w3.org/2005/10/Process-20051014/tr.html#RecsWD"
shape="rect">W3C Working Draft</a>. It has been produced as part of
the <a href="http://www.w3.org/Voice/Activity.html"
shape="rect">Voice Browser Activity</a>. The authors of this
document are participants in the <a href="http://www.w3.org/Voice/"
shape="rect">Voice Browser Working Group</a>. For more information
see the <a href="http://www.w3.org/Voice/#faq" shape="rect">Voice
Browser FAQ</a>. The Working Group expects to advance this Working
Draft to Recommendation status.</p>
<p>Comments are welcome on <a href="mailto:www-voice@w3.org"
shape="rect">www-voice@w3.org</a> (<a
href="http://lists.w3.org/Archives/Public/www-voice/"
shape="rect">archive</a>). See <a href="http://www.w3.org/Mail/"
shape="rect">W3C mailing list and archive usage guidelines</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>
<p>This document was produced by a group operating under the <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/"
shape="rect">5 February 2004 W3C Patent Policy</a>. W3C maintains a
<a rel="disclosure"
href="http://www.w3.org/2004/01/pp-impl/34665/status"
shape="rect">public list of any patent disclosures</a> made in
connection with the deliverables of the group; that page also
includes instructions for disclosing a patent. An individual who
has actual knowledge of a patent which the individual believes
contains <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential"
shape="rect">Essential Claim(s)</a> must disclose the information
in accordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure"
shape="rect">section 6 of the W3C Patent Policy</a>.</p>
</div>
<div class="toc">
<h2><a name="contents" id="contents" />Table of Contents</h2>
<p class="toc">1 <a href="#Terminology">Terminology</a><br />
2 <a href="#Overview">Overview</a><br />
2.1 <a
href="#overview.v3structure">Structure of VoiceXML 3.0</a><br />
2.2 <a
href="#overview.docstructure">Structure of this document</a><br />
2.3 <a href="#overview.howtoread">How to
read this document</a><br />
3 <a href="#DFP">Data Flow Presentation (DFP) Framework</a><br />
3.1 <a href="#Data">Data</a><br />
3.2 <a href="#DFP:Flow">Flow</a><br />
3.3 <a
href="#Presentation">Presentation</a><br />
4 <a href="#Framework">Core Concepts</a><br />
4.1 <a href="#Descriptions">Syntactic and
Semantic descriptions</a><br />
4.2 <a href="#Model.xml">Resources,
Resource Controllers, and Events</a><br />
4.2.1 <a
href="#Framework:Controller">Top Level Controller</a><br />
4.3 <a href="#Syntax">Syntax</a><br />
4.4 <a href="#Eventing">Event
Model</a><br />
4.4.1 <a
href="#InternalEvents">Internal Events</a><br />
4.4.1.1
<a href="#d3e461">Event Interfaces</a><br />
4.4.1.1.1
<a href="#d3e477">Event</a><br />
4.4.1.1.2
<a href="#d3e497">EventTarget</a><br />
4.4.1.1.3
<a href="#d3e508">EventListener</a><br />
4.4.1.2
<a href="#d3e519">Event Flow</a><br />
4.4.1.2.1
<a href="#d3e525">Event Listener Registration</a><br />
4.4.1.2.2
<a href="#d3e536">Event Listener Activation</a><br />
4.4.2 <a
href="#ExternalEvents">External Events</a><br />
4.5 <a
href="#DocumentInitialization">Document Initialization and
Execution</a><br />
4.5.1 <a
href="#d3e584">Initialization</a><br />
4.5.1.1
<a href="#d3e591">DOM Processing</a><br />
4.5.1.2
<a href="#d3e619">Preparation for Execution</a><br />
4.5.2 <a
href="#d3e632">Execution</a><br />
4.5.2.1
<a href="#d3e640">Subdialogs</a><br />
4.5.2.2
<a href="#ApplicationRoot">Application Root</a><br />
4.5.2.3
<a href="#d3e650">Summary of Syntax/Semantics Interaction</a><br />
4.5.3 <a
href="#d3e667">Transition Controllers</a><br />
5 <a href="#Resources">Resources</a><br />
5.1 <a
href="#Resources:Datamodel">Datamodel Resource</a><br />
5.1.1 <a
href="#Resources:Datamodel:API">Data Model Resource API</a><br />
5.2 <a href="#Resources:PromptQueue">Prompt
Queue Resource</a><br />
5.2.1 <a
href="#PromptQueue:StateChartRepresentation">State Chart
Representation</a><br />
5.2.2 <a
href="#PromptQueue:SCXMLRepresentation">SCXML
Representation</a><br />
5.2.3 <a
href="#PromptQueue:DefinedEvents">Defined Events</a><br />
5.2.4 <a
href="#d3e939">Device Events</a><br />
5.2.5 <a
href="#d3e990">Open Issue</a><br />
5.3 <a
href="#Resources:Recognition">Recognition Resources</a><br />
5.3.1 <a
href="#d3e1018">Definition</a><br />
5.3.2 <a
href="#d3e1159">Defined Events</a><br />
5.3.3 <a
href="#d3e1321">Device Events</a><br />
5.3.4 <a
href="#d3e1423">State Chart Representation</a><br />
5.3.5 <a
href="#d3e1435">SCXML Representation</a><br />
5.4 <a
href="#Resources:Connection">Connection Resource</a><br />
5.4.1 <a
href="#ConnectionResource:Definition">Definition</a><br />
5.4.2 <a
href="#ConnectionResource:FinalProcessing">Final Processing
State</a><br />
5.4.3 <a
href="#d3e1455">Defined Events</a><br />
5.4.4 <a
href="#d3e1530">State Chart Representation</a><br />
5.4.5 <a
href="#d3e1536">SCXML Representation</a><br />
5.5 <a href="#Resources:Timer">Timer
Resource</a><br />
5.5.1 <a
href="#d3e1545">Definition</a><br />
5.5.2 <a
href="#d3e1550">Defined Events</a><br />
5.5.3 <a
href="#d3e1629">Device Events</a><br />
5.5.4 <a
href="#d3e1668">State Chart Representation</a><br />
6 <a href="#Modules">Modules</a><br />
6.1 <a
href="#Grammar:GrammarModule">Grammar Module</a><br />
6.1.1 <a
href="#GrammarModule:Syntax">Syntax</a><br />
6.1.1.1
<a href="#d3e1706">Attributes</a><br />
6.1.1.2
<a href="#d3e1758">Content Model</a><br />
6.1.2 <a
href="#GrammarModule:Semantics">Semantics</a><br />
6.1.2.1
<a href="#d3e1783">Definition</a><br />
6.1.2.2
<a href="#d3e1861">Defined Events</a><br />
6.1.2.3
<a href="#d3e1930">External Events</a><br />
6.1.2.4
<a href="#d3e1968">State Chart Representation</a><br />
6.1.2.5
<a href="#d3e1971">SCXML Representation</a><br />
6.1.3 <a
href="#d3e1997">Events</a><br />
6.1.4 <a
href="#grammar:examples">Examples</a><br />
6.2 <a
href="#Grammar:InlineSRGSGrammarModule">Inline SRGS Grammar
Module</a><br />
6.2.1 <a
href="#InlineSRGSGrammarModule:Syntax">Syntax</a><br />
6.2.2 <a
href="#InlineSRGSGrammarModule:Semantics">Semantics</a><br />
6.2.2.1
<a href="#d3e2057">Definition</a><br />
6.2.2.2
<a href="#d3e2083">Defined Events</a><br />
6.2.2.3
<a href="#d3e2135">External Events</a><br />
6.2.2.4
<a href="#d3e2140">State Chart Representation</a><br />
6.2.2.5
<a href="#d3e2144">SCXML Representation</a><br />
6.2.3 <a
href="#InlineSRGSGrammarModule:Events">Events</a><br />
6.2.4 <a
href="#InlineSRGSGrammarModule:examples">Examples</a><br />
6.3 <a
href="#Grammar:ExternalGrammarModule">External Grammar
Module</a><br />
6.3.1 <a
href="#Grammar:ExternalGrammarModule:Syntax">Syntax</a><br />
6.3.1.1
<a href="#d3e2188">Attributes</a><br />
6.3.1.2
<a href="#ExternalSRGSGrammar:occurrence">Content Model</a><br />
6.3.2 <a
href="#Grammar:ExternalGrammarModule:Semantics">Semantics</a><br />
6.3.2.1
<a href="#d3e2368">Definition</a><br />
6.3.2.2
<a href="#d3e2394">Defined Events</a><br />
6.3.2.3
<a href="#d3e2463">External Events</a><br />
6.3.2.4
<a href="#d3e2468">State Chart Representation</a><br />
6.3.2.5
<a href="#d3e2472">SCXML Representation</a><br />
6.3.3 <a
href="#Grammar:ExternalGrammarModule:Events">Events</a><br />
6.3.4 <a
href="#external_grammar:examples">Examples</a><br />
6.4 <a href="#PromptModule">Prompt
Module</a><br />
6.4.1 <a
href="#PromptModule:Syntax">Syntax</a><br />
6.4.1.1
<a href="#d3e2534">Attributes</a><br />
6.4.1.2
<a href="#d3e2643">Content Model</a><br />
6.4.2 <a
href="#PromptModule:Semantics">Semantics</a><br />
6.4.2.1
<a href="#d3e2655">Definition</a><br />
6.4.2.2
<a href="#d3e2690">Defined Events</a><br />
6.4.2.3
<a href="#d3e2775">External Events</a><br />
6.4.2.4
<a href="#d3e2817">State Chart Representation</a><br />
6.4.2.5
<a href="#d3e2823">SCXML Representation</a><br />
6.4.3 <a
href="#PromptModule:Events">Events</a><br />
6.4.4 <a
href="#prompt:examples">Examples</a><br />
6.5 <a href="#BuiltinSSMLModule">Builtin
SSML Module</a><br />
6.5.1 <a
href="#SSMLModule:Syntax">Syntax</a><br />
6.5.2 <a
href="#SSMLModule:Semantics">Semantics</a><br />
6.5.3 <a
href="#SSML_prompt:examples">Examples</a><br />
6.6 <a href="#MediaModule">Media
Module</a><br />
6.6.1 <a
href="#MediaModule:Syntax">Syntax</a><br />
6.6.1.1
<a href="#d3e3048">Attributes</a><br />
6.6.1.2
<a href="#d3e3275">Content Model</a><br />
6.6.1.2.1
<a href="#d3e3302">Tips (informative)</a><br />
6.6.2 <a
href="#MediaModule:Semantics">Semantics</a><br />
6.6.3 <a
href="#MediaModule:Examples">Examples</a><br />
6.7 <a href="#ParseqModule">Parseq
Module</a><br />
6.7.1 <a
href="#ParseqModule:Syntax">Syntax</a><br />
6.7.2 <a
href="#ParseqModule:Semantics">Semantics</a><br />
6.7.3 <a
href="#ParseqModule:Examples">Examples</a><br />
6.8 <a href="#ForeachModule">Foreach
Module</a><br />
6.8.1 <a
href="#ForeachModule:Syntax">Syntax</a><br />
6.8.1.1
<a href="#d3e3564">Attributes</a><br />
6.8.1.2
<a href="#d3e3616">Content Model</a><br />
6.8.2 <a
href="#ForeachModule:Semantics">Semantics</a><br />
6.8.3 <a
href="#ForeachModule:examples">Examples</a><br />
6.9 <a href="#FormModule">Form
Module</a><br />
6.9.1 <a
href="#d3e3661">Syntax</a><br />
6.9.2 <a
href="#d3e3696">Semantics</a><br />
6.9.2.1
<a href="#RC:Form">Form RC</a><br />
6.9.2.1.1
<a href="#d3e3715">Definition</a><br />
6.9.2.1.2
<a href="#d3e3768">Defined Events</a><br />
6.9.2.1.3
<a href="#d3e3852">External Events</a><br />
6.9.2.1.4
<a href="#d3e3952">State Chart Representation</a><br />
6.9.2.1.5
<a href="#d3e3964">SCXML Representation</a><br />
6.10 <a href="#FieldModule">Field
Module</a><br />
6.10.1 <a
href="#d3e3972">Syntax</a><br />
6.10.2 <a
href="#d3e4024">Semantics</a><br />
6.10.2.1
<a href="#RC:Field">Field RC</a><br />
6.10.2.1.1
<a href="#d3e4038">Definition</a><br />
6.10.2.1.2
<a href="#d3e4095">Defined Events</a><br />
6.10.2.1.3
<a href="#d3e4202">External Events</a><br />
6.10.2.1.4
<a href="#d3e4254">State Chart Representation</a><br />
6.10.2.1.5
<a href="#d3e4260">SCXML Representation</a><br />
6.10.2.2
<a href="#RC:PlayAndRecognize">PlayandRecognize RC</a><br />
6.10.2.2.1
<a href="#d3e4291">Definition</a><br />
6.10.2.2.2
<a href="#d3e4373">Defined Events</a><br />
6.10.2.2.3
<a href="#d3e4500">External Events</a><br />
6.10.2.2.4
<a href="#d3e4656">State Chart Representation</a><br />
6.10.2.2.5
<a href="#d3e4666">SCXML Representation</a><br />
6.11 <a href="#BuiltinModule">Builtin
Grammar Module</a><br />
6.11.1 <a
href="#d3e4674">Usage of Platform Grammars</a><br />
6.11.2 <a
href="#d3e4688">Platform Requirements</a><br />
6.11.3 <a
href="#d3e4701">Syntax and Semantics</a><br />
6.11.4 <a
href="#d3e4794">Examples</a><br />
6.12 <a href="#DAMModule">Data Access and
Manipulation Module</a><br />
6.12.1 <a
href="#d1e73">Overview</a><br />
6.12.2 <a
href="#d1e82">Semantics</a><br />
6.12.2.1
<a href="#d1e88">The scope stack</a><br />
6.12.2.2
<a href="#d1e162">Relevance of scope stack to properties</a><br />
6.12.2.3
<a href="#d1e174">Implicit variables</a><br />
6.12.2.4
<a href="#d1e246">Variable resolution</a><br />
6.12.2.5
<a href="#d1e344">Standard session variables</a><br />
6.12.2.6
<a href="#d1e402">Standard application variables</a><br />
6.12.2.7
<a href="#d1e505">Legal variable values and expressions</a><br />
6.12.3 <a
href="#d1e514">Syntax</a><br />
6.12.3.1
<a href="#d1e520">Creating variables: the <var>
element</a><br />
6.12.3.2
<a href="#d1e742">Reading variables: "expr" and "cond" attributes
and the <value> element</a><br />
6.12.3.2.1
<a href="#d1e751">Inserting variable values in prompts: The
<value> element</a><br />
6.12.3.3
<a href="#d1e907">Updating variables: the <assign> and
<data> elements</a><br />
6.12.3.3.1
<a href="#d1e910">The <assign> element</a><br />
6.12.3.3.2
<a href="#d1e1108">The <data> element</a><br />
6.12.3.4
<a href="#d1e1456">Deleting variables: the <clear>
element</a><br />
6.12.3.5
<a href="#d1e1703">Relevance for properties</a><br />
6.12.4 <a
href="#d1e1712">Backward compatibility with VoiceXML 2.1</a><br />
6.12.5 <a
href="#d1e1757">Implicit functions using XPath</a><br />
6.13 <a
href="#ExternalCommunicationModule">External Communication
Module</a><br />
6.13.1 <a
href="#ExternalCommunicationModule:Receive">Receiving external
messages within a voice application</a><br />
6.13.1.1
<a href="#ExternalCommunicationModule:ReceiveReflect">External
Message Reflection</a><br />
6.13.1.2
<a href="#ExternalCommunicationModule:ReceiveAsync">Receiving
External Messages Asynchronously</a><br />
6.13.1.3
<a href="#ExternalCommunicationModule:ReceiveSync">Receiving
External Messages Synchronously</a><br />
6.13.1.3.1
<a
href="#ExternalCommunicationModule:ReceiveSyncReceive"><receive></a><br />
6.13.2 <a
href="#ExternalCommunicationModule:Send">Sending messages from a
voice application</a><br />
6.13.2.1
<a
href="#ExternalCommunicationModule:SendTimeout">sendtimeout</a><br />
6.14 <a href="#SessionRootModule">Session
Root Module</a><br />
6.14.1 <a
href="#SessionRootModule:Syntax">Syntax</a><br />
6.14.2 <a
href="#SessionRootModule:Semantics">Semantics</a><br />
6.14.3 <a
href="#SessionRootModule:examples">Examples</a><br />
6.15 <a href="#RunTimeControl">Run Time
Control Module</a><br />
6.15.1 <a
href="#d3e6567"><rtc></a><br />
6.15.1.1
<a href="#d3e6570">Syntax</a><br />
6.15.2 <a
href="#d3e6620"><cancelrtc></a><br />
6.15.2.1
<a href="#d3e6625">Syntax</a><br />
6.15.3 <a
href="#d3e6639">Semantics</a><br />
6.15.4 <a
href="#d3e6648">Examples</a><br />
6.16 <a href="#SIV">SIV Module</a><br />
6.16.1 <a
href="#d3e6720">SIV Core Functions</a><br />
6.16.2 <a
href="#d3e6773">Syntax</a><br />
6.16.3 <a
href="#SIVModule:Semantics">Semantics</a><br />
6.16.3.1
<a href="#d3e7035">Definition</a><br />
6.16.3.2
<a href="#d3e1625">Defined Events</a><br />
6.16.3.3
<a href="#d3e1694">External Events</a><br />
6.16.3.4
<a href="#d3e7305">State Chart Representation</a><br />
6.16.4 <a
href="#d3e7310">Events</a><br />
6.16.5 <a
href="#d3e7351">Examples</a><br />
6.17 <a href="#SubdialogModule">Subdialog
Module</a><br />
6.17.1 <a
href="#SubdialogModule:Syntax">Syntax</a><br />
6.17.2 <a
href="#SubdialogModule:Semantics">Semantics</a><br />
6.17.3 <a
href="#SubdialogModule:Examples">Examples</a><br />
6.18 <a href="#DisconnectModule">Disconnect
Module</a><br />
6.18.1 <a
href="#DisconnectModule:Syntax">Syntax</a><br />
6.18.1.1
<a href="#d3e7413">Attributes</a><br />
6.18.1.2
<a href="#d3e7446">Content Model</a><br />
6.18.2 <a
href="#DisconnectModule:Semantics">Semantics</a><br />
6.18.2.1
<a href="#d3e7456">Definition</a><br />
6.18.2.2
<a href="#d3e7502">Defined Events</a><br />
6.18.2.3
<a href="#d3e7594">External Events</a><br />
6.18.2.4
<a href="#d3e7621">State Chart Representation</a><br />
6.18.2.5
<a href="#d3e7627">SCXML Representation</a><br />
6.18.3 <a
href="#DisconnectModule:Example">Example</a><br />
6.19 <a href="#PlayModule">Play
Module</a><br />
6.19.1 <a
href="#PlayModule:Semantics">Semantics</a><br />
6.19.1.1
<a href="#d3e7651">Definition</a><br />
6.19.1.2
<a href="#d3e7672">Defined Events</a><br />
6.19.1.3
<a href="#d3e7718">External Events</a><br />
6.19.1.4
<a href="#d3e7743">State Chart Representation</a><br />
6.19.1.5
<a href="#d3e7749">SCXML Representation</a><br />
6.20 <a href="#RecordModule">Record
Module</a><br />
6.20.1 <a
href="#RecordModule:Syntax">Syntax</a><br />
6.20.1.1
<a href="#d3e7772">Attributes</a><br />
6.20.1.2
<a href="#d3e7897">Content Model</a><br />
6.20.1.3
<a href="#d3e7915">Data Model Variables</a><br />
6.20.2 <a
href="#RecordModule:Semantics">Semantics</a><br />
6.20.2.1
<a href="#RC:RecordInputItem">RecordInputItem RC</a><br />
6.20.2.1.1
<a href="#d3e7970">Definition</a><br />
6.20.2.1.2
<a href="#d3e8002">Defined Events</a><br />
6.20.2.1.3
<a href="#d3e8049">External Events</a><br />
6.20.2.1.4
<a href="#d3e8076">State Chart Representation</a><br />
6.20.2.1.5
<a href="#d3e8082">SCXML Representation</a><br />
6.20.2.2
<a href="#RC:Record">Record RC</a><br />
6.20.2.2.1
<a href="#d3e8092">Definition</a><br />
6.20.2.2.2
<a href="#d3e8104">Defined Events</a><br />
6.20.2.2.3
<a href="#d3e8167">External Events</a><br />
6.20.2.2.4
<a href="#d3e8271">State Chart Representation</a><br />
6.20.2.2.5
<a href="#d3e8277">SCXML Representation</a><br />
6.21 <a href="#PropertyModule">Property
Module</a><br />
6.21.1 <a
href="#PropertyModule:Syntax">Syntax</a><br />
6.21.1.1
<a href="#d3e8298">Attributes</a><br />
6.21.1.2
<a href="#d3e8352">Content Model</a><br />
6.21.2 <a
href="#PropertyModule:Semantics">Semantics</a><br />
6.21.2.1
<a href="#d3e8366">Definition</a><br />
6.21.2.2
<a href="#d3e8371">Defined Events</a><br />
6.21.2.3
<a href="#d3e8376">External Events</a><br />
6.21.2.4
<a href="#d3e8381">State Chart Representation</a><br />
6.21.2.5
<a href="#d3e8387">SCXML Representation</a><br />
6.21.3 <a
href="#PropertyModule:Events">Events</a><br />
6.21.4 <a
href="#property:examples">Examples</a><br />
6.22 <a href="#ControllerModule">Transition
Controller Module</a><br />
6.22.1 <a
href="#ControllerModule:Syntax">Syntax</a><br />
6.22.1.1
<a href="#d3e8433">Attributes</a><br />
6.22.1.2
<a href="#d3e8497">Content Model</a><br />
6.22.2 <a
href="#ControllerModule:Semantics">Semantics</a><br />
6.22.2.1
<a href="#d3e8511">Definition</a><br />
6.22.2.2
<a href="#d3e8515">Defined Events</a><br />
6.22.2.3
<a href="#d3e8519">External Events</a><br />
6.22.2.4
<a href="#d3e8523">State Chart Representation</a><br />
6.22.2.5
<a href="#d3e8527">SCXML Representation</a><br />
6.22.3 <a
href="#ControllerModule:Events">Events</a><br />
6.22.4 <a
href="#controller:examples">Examples</a><br />
7 <a href="#Profiles">Profiles</a><br />
7.1 <a href="#Profile:Legacy">Legacy
Profile</a><br />
7.1.1 <a
href="#Legacy:Conformance">Conformance</a><br />
7.1.1.1
<a href="#Legacy:RootRequirements">Vxml Root Module
Requirements</a><br />
7.1.1.2
<a href="#Legacy:FormRequirements">Form Module
Requirements</a><br />
7.1.1.3
<a href="#Legacy:FieldRequirements">Field Module
Requirements</a><br />
7.1.1.4
<a href="#Legacy:PromptRequirements">Prompt Module
Requirements</a><br />
7.1.1.5
<a href="#Legacy:GrammarRequirements">Grammar Module
Requirements</a><br />
7.1.1.6
<a href="#Legacy:DataRequirements">Data Access and Manipulation
Module Requirements</a><br />
7.1.2 <a
href="#Legacy:Convenience_Syntax">Convenience Syntax</a><br />
7.1.3 <a
href="#Legacy:Default">Default Handlers and Transition
Controllers</a><br />
7.2 <a href="#Profile:Basic">Basic
Profile</a><br />
7.2.1 <a
href="#BasicProfile:Introduction">Introduction</a><br />
7.2.2 <a
href="#BasicProfile:Contents">What the Basic Profile
includes</a><br />
7.2.2.1
<a href="#BasicProfile:SIV">SIV functions</a><br />
7.2.2.2
<a href="#BasicProfile:Presentation">Presentation
functions</a><br />
7.2.2.3
<a href="#BasicProfile:Capture">Capture functions</a><br />
7.2.2.4
<a href="#BasicProfile:Other">Other modules</a><br />
7.2.3 <a
href="#BasicProfile:Results">Returned results</a><br />
7.2.4 <a
href="#BasicProfile:NotIncluded">What the Basic Profile does not
include</a><br />
7.2.5 <a
href="#BasicProfile:Examples">Examples</a><br />
7.3 <a href="#Profile:Maximal">Maximal
Profile</a><br />
7.4 <a href="#Profile:Enhanced">Enhanced
Profile</a><br />
7.5 <a
href="#Profile:ConvenienceSyntax">Convenience Syntax (Syntactic
Sugar)</a><br />
8 <a href="#Environment">Environment</a><br />
8.1 <a href="#ResourceFetching">Resource
Fetching</a><br />
8.1.1 <a
href="#Fetching">Fetching</a><br />
8.1.2 <a
href="#Caching">Caching</a><br />
8.1.2.1
<a href="#Controlling_the_Caching_Policy">Controlling the Caching
Policy</a><br />
8.1.3 <a
href="#Prefetching">Prefetching</a><br />
8.1.4 <a
href="#Protocols">Protocols</a><br />
8.2 <a
href="#Properties">Properties</a><br />
8.2.1 <a
href="#Properties:ASR">Speech Recognition Properties</a><br />
8.2.2 <a
href="#Properties:DTMF">DTMF Recognition Properties</a><br />
8.2.3 <a
href="#Properties:PromptandCollect">Prompt and Collect
Properties</a><br />
8.2.4 <a
href="#Properties:Media">Media Properties</a><br />
8.2.5 <a
href="#Properties:Fetch">Fetch Properties</a><br />
8.2.6 <a
href="#Properties:Misc">Miscellaneous Properties</a><br />
8.3 <a href="#Timing_Properties">Speech and
DTMF Input Timing Properties</a><br />
8.3.1 <a
href="#d3e9650">DTMF Grammars</a><br />
8.3.1.1
<a href="#timeout_No_Input_Provided">timeout, No Input
Provided</a><br />
8.3.1.2
<a
href="#interdigittimeout_Grammar_is_Not_Ready_to_Terminate">interdigittimeout,
Grammar is Not Ready to Terminate</a><br />
8.3.1.3
<a
href="#interdigittimeout_Grammar_is_Ready_to_Terminate">interdigittimeout,
Grammar is Ready to Terminate</a><br />
8.3.1.4
<a
href="#termchar_and_interdigittimeout_Grammar_Can_Terminate">termchar
and interdigittimeout, Grammar Can Terminate</a><br />
8.3.1.5
<a href="#termchar_Empty_When_Grammar_Must_Terminate">termchar
Empty When Grammar Must Terminate</a><br />
8.3.1.6
<a href="#d3e9702">termchar Non-Empty and termtimeout When Grammar
Must Terminate</a><br />
8.3.1.7
<a href="#d3e9711">termchar Non-Empty and termtimeout When Grammar
Must Terminate</a><br />
8.3.1.8
<a href="#Invalid_DTMF_Input">Invalid DTMF Input</a><br />
8.3.2 <a
href="#d3e9725">Speech Grammars</a><br />
8.3.2.1
<a href="#timeout_When_No_Speech_Provided">timeout When No Speech
Provided</a><br />
8.3.2.2
<a
href="#completetimeout_With_Speech_Grammar_Recognized">completetimeout
With Speech Grammar Recognized</a><br />
8.3.2.3
<a
href="#incompletetimeout_with_Speech_Grammar_Unrecognized">incompletetimeout
with Speech Grammar Unrecognized</a><br />
8.4 <a href="#ValueDesignations">Value
Designations</a><br />
8.4.1 <a
href="#IntegerDesignation">Integers</a><br />
8.4.2 <a
href="#RealNumberDesignation">Real Numbers</a><br />
8.4.3 <a
href="#TimeDesignation">Times</a><br />
9 <a href="#Integration">Integration with Other Markup
Languages</a><br />
9.1 <a
href="#Integration:WithinSCXML">Embedding of VoiceXML within
SCXML</a><br />
9.2 <a
href="#Integration:InsideVoiceXML">Integrating Flow Control
Languages into VoiceXML</a><br />
9.2.1 <a
href="#Integration:InsideVoiceXML:SCXMLForDialog">SCXML for Dialog
Management</a><br />
9.2.1.1
<a
href="#Integration:InsideVoiceXML:SCXMLForDialog:SystemDriven">System-driven
Dialog</a><br />
9.2.1.2
<a
href="#Integration:InsideVoiceXML:SCXMLForDialog:UserDriven">User-driven
Dialog</a><br />
9.2.2 <a
href="#Integration:InsideVoiceXML:GracefulDegradation">Graceful
Degradation</a><br />
9.2.3 <a
href="#Integration:InsideVoiceXML:RecursiveMVC">SCXML as Basis for
Recursive MVC</a><br />
</p>
<h3><a name="appendices" id="appendices" />Appendices</h3>
<p class="toc">A <a
href="#Acknowledgements">Acknowledgements</a><br />
B <a href="#References">References</a><br />
B.1 <a href="#d3e9925">Normative
References</a><br />
B.2 <a href="#d3e9988">Informative
References</a><br />
C <a href="#Glossary_of_Terms">Glossary of Terms</a><br />
D <a href="#Schema">VoiceXML 3.0 XML Schema</a><br />
D.1 <a href="#Schema:Root">Schema for VXML
Root Module</a><br />
D.2 <a href="#Schema:Form">Schema for Form
Module</a><br />
D.3 <a href="#Schema:Field">Schema for
Field Module</a><br />
D.4 <a href="#Schema:Prompt">Schema for
Prompt Module</a><br />
D.5 <a href="#Schema:BuiltinSSML">Schema
for Builtin SSML Module</a><br />
D.6 <a href="#Schema:Foreach">Schema for
Foreach Module</a><br />
D.7 <a href="#Schema:Data">Schema for Data
Access and Manipulation Module</a><br />
D.8 <a href="#Schema:Legacy">Schema for
Legacy Profile</a><br />
E <a href="#V2Convenience">Convenience Syntax in VoiceXML
2.x</a><br />
E.1 <a
href="#V2Convenience:SimplifiedDialogs">Simplified Dialog
Structure</a><br />
E.2 <a
href="#V2Convenience:Examples">Examples</a><br />
E.2.1 <a
href="#V2Convenience:MenuWithChoice"><menu> with
<choice></a><br />
E.2.2 <a
href="#V2Convenience:EquivFormFieldOption">Equivalent <form>,
<field>, <option></a><br />
E.2.3 <a
href="#V2Convenience:EquivFormFieldGrammar">Equivalent
<form>, <field>, <grammar></a><br />
F <a href="#Changes">Major changes since the last Working
Draft</a><br />
</p>
</div>
<hr />
<div class="body">
<div class="div1">
<h2><a name="Terminology" id="Terminology" />1 Terminology</h2>
<p>In this document, the key words "must", "must not", "required",
"shall", "shall not", "should", "should not", "recommended", "may",
and "optional" are to be interpreted as described in <a
href="#RFC2119">[RFC2119]</a> and indicate required levels for
compliant VoiceXML 3.0 implementations.</p>
<p>Terms used in this specification are defined in Appendix <a
href="#Glossary_of_Terms"><b>C Glossary of Terms</b></a>.</p>
</div>
<div class="div1">
<h2><a name="Overview" id="Overview" />2 Overview</h2>
<p>How does one build a successor to VoiceXML 2.0/2.1? Requests for
improvements to VoiceXML fell into two main categories:
extensibility and new functionality.</p>
<p>To accommodate both, the Voice Browser Working Group</p>
<ol class="enumar">
<li>Developed the detailed semantic descriptions of VoiceXML
functionality that versions 2.0 and 2.1 lacked. The semantic
descriptions clarify the meaning of the VoiceXML 2.0 and 2.1
functionalities and how they relate to each other. The semantic
descriptions are represented in this document as English text, UML
state chart visual diagrams [<font color="red"><xref>UML 2
State Machine Diagrams</xref></font> and/or textual SCXML
representations [<font color="red"><xref>State Chart XML
(SCXML): State Machine Notation for Control
Abstraction</xref></font>]. Figure 1 illustrates the VoiceXML
3.0 framework which illustrates some abstract UML state chart
visual diagrams representing some existing VoiceXML functionality.
<img class="center" src="Images/2.0_functionality.png"
alt="Functionality from VoiceXML 2.0" />
<p class="caption">Figure 1: VoiceXML 3.0 Framework - The
red-filled cells indicates some functionality from VoiceXML 2.0
expressed as state charts</p>
</li>
<li>Described the detailed semantics for new functionality. New
functions include, for example, speaker identification and
verification, video capture and replay, and a more powerful prompt
queue. These semantic descriptions for these new functions are also
represented in this document as English text, UML state chart
visual diagrams [ref] and/or textual SCXML representations [ref].
Figure 2 contains some abstract UML state chart visual diagrams
representing new functionality. <img class="center"
src="Images/new_functionality.png" alt="New functionality" />
<p class="caption">Figure 2: VoiceXML 3.0 Framework - The
red-filled cells indicates new functionality</p>
</li>
<li>Organized the functionality into modules, with each module
implementing different functions. One reason for the introduction
of a more rigorous semantic definition is that it allows us to
assign semantics to individual modules. This makes it easier to
understand what happens when modules are combined or new ones are
defined. In contrast, VoiceXML 2.0 and 2.1 had a single global
semantic definition (the FIA), which made it difficult to
understand what would happen if certain elements were removed from
the language or if new ones were added. Figure 3 illustrates some
modules, each containing VoiceXML 3.0 functionality Vendors may
extend VoiceXML functionality by creating additional modules with
additional functionality not described in this document. For
example, a vendor might create a new GPS input module. Application
developers should be cautious about using vendor-specific modules
because the resulting application may not be portable. <img
class="center" src="Images/modules.png" alt="Modules" />
<p class="caption">Figure 3: VoiceXML 3.0 Framework - The red
bolded rectangles indicates modules</p>
</li>
<li>Restructured and revised the syntax of each module to
incorporate any new functionality. Application developers use the
syntax of each module as an API to invoke the module’s functions.
Figure 4 illustrates some simplified syntax associated with
modules. <img class="center" src="Images/syntax.png"
alt="Syntax" />
<p class="caption">Figure 4: VoiceXML 3.0 Framework - The bolded
red text indicates syntax</p>
</li>
<li>Introduced the concept of a profile (language) which
incorporates the syntax of several modules. Figure 5 illustrates
two profiles. For example, a VoiceXML 2.1 profile incorporates the
syntax of most of the modules corresponding to the VoiceXML 2.1
functionality which will support most existing VoiceXML 2.1
applications. Thus most VoiceXML 2.1 applications can be easily
ported to VoiceXML 3.0 using the VoiceXML 2.1 profile. Another
profile omits the VoiceXML 2.1 Form Interpretation Algorithm (FIA).
This profile may be used by developers who want to define their one
own flow control rather than using the FIA. Profiles enable
platform developers to select just the functionality that
application developers need for a platform or class of application.
Multiple profiles enables developers to use just the profile
(language) needed for a platform or class of applications. For
example, a lean profile for portable devices, or a full-function
profile for servers-based applications using all of the new
functionality of VoiceXML 3.0. <img class="center"
src="Images/profiles.png" alt="Profiles" />
<p class="caption">Figure 5: VoiceXML 3.0 Framework - The dotted
red area and the dashed green area indicate two profiles</p>
</li>
</ol>
<p>One of the benefits of detailed semantic descriptions is
improving portability within VoiceXML. Two vendors may implement
the same functionality differently; however, the functionality must
be consistent with the semantic meanings described in this document
so that application authors are isolated from the different
implementations. This increases portable among platforms that
support the same syntax. Note that there are many other factors
that effect to the portability that is outside the scope of this
document (e.g. speech recognition capabilities, telephony).</p>
<div class="div2">
<h3><a name="overview.v3structure" id="overview.v3structure" />2.1
Structure of VoiceXML 3.0</h3>
<p>This document covers the following:</p>
<ul>
<li>This document explains the core of VoiceXML 3.0, an extensible
framework that describes how semantics are defined, how syntax is
defined and how the two are connected together. In this document,
the "semantics" are the definitions of core functionality, such as
might be used by an implementer of VoiceXML 3.0. The definitions
are represented as English text, SCXML syntax, and/or state chart
diagrams. The term "syntax" refers to XML elements and attributes
that are an application author's programming interface to the
functionality defined by the "semantics".</li>
<li>Within this document, all the functionality of VoiceXML 3.0 is
grouped into modules of related capabilities.</li>
<li>Modules can be combined together to create complete profiles
(languages). This document describes how to define both modules and
profiles.</li>
<li>In addition to describing the general framework, this document
explicitly defines a broad range of functionality, several modules
and two profiles.</li>
</ul>
</div>
<div class="div2">
<h3><a name="overview.docstructure"
id="overview.docstructure" />2.2 Structure of this document</h3>
<p>The remainder of this document is structured as follows:</p>
<p><a href="#DFP"><b>3 Data Flow Presentation (DFP)
Framework</b></a> presents the Data-Flow-Presentation Framework,
its importance for the development of VoiceXML 3.0 and how VoiceXML
3.0 fits into the model.</p>
<p><a href="#Framework"><b>4 Core Concepts</b></a> explains the
core concepts underlying the new structure for VoiceXML, including
resources, resource controllers, the relationship between syntax
and semantics, DOM eventing, modules and profiles.</p>
<p><a href="#Resources"><b>5 Resources</b></a> presents the
resources defined for the language. These provide the key
presentation-related functionality in the language.</p>
<p><a href="#Modules"><b>6 Modules</b></a> presents the modules
defined for the language. Each module consists of a syntax piece
(with its user-visible events), a semantics piece (with its
behind-the-scenes events) and a description of how the two are
connected.</p>
<p><a href="#Profiles"><b>7 Profiles</b></a> presents two profiles.
The first, the VoiceXML 2.1 profile, shows how a language similar
to VoiceXML 2.1 can be created using the structure and
functionality of VoiceXML 3.0. The second, the Basic profile,
leaves out higher-level flow control constructs such as
<form> and the associated Form Interpretation Algorithm.</p>
<p>The Appendices provide useful references and a glossary of terms
used in the specification.</p>
</div>
<div class="div2">
<h3><a name="overview.howtoread" id="overview.howtoread" />2.3 How
to read this document</h3>
<p>For everyone: Please first read <a href="#DFP"><b>3 Data Flow
Presentation (DFP) Framework</b></a>. The data-flow- presentation
distinction applies not only to VoiceXML 3.0, but to many of W3C's
specifications. Understanding VoiceXML's role as a presentation
language is crucial context for understanding the rest of the
specification.</p>
<p>For application authors: we recommend that you begin with syntax
and only gradually explore details of the semantics as you need to
understand behavioral specifics.</p>
<ol class="enumar">
<li>If you are familiar with VoiceXML 2 you might want to begin
with the Legacy profile in <a href="#Profile:Legacy"><b>7.1 Legacy
Profile</b></a> to see an example of all the syntactic pieces in
the finished profile.</li>
<li>You should then review the syntax sections of each of the
modules in <a href="#Modules"><b>6 Modules</b></a>, along with the
Basic profile in <a href="#Profile:Basic"><b>7.2 Basic
Profile</b></a>. When you need to understand how a bit of syntax is
implemented, read the semantics section corresponding to that
syntax.</li>
<li>Along the way you will definitely want to review the parts of
<a href="#Framework"><b>4 Core Concepts</b></a> that are relevant
to your other reading (profiles, modules, syntax, semantics, and
DOM eventing).</li>
</ol>
<p>For VoiceXML platform developers: we recommend that you begin
with the functionality and framework and only focus on syntax
later.</p>
<ol class="enumar">
<li>If you are familiar with VoiceXML 2 you might want to begin
with the Legacy profile in <a href="#Profile:Legacy"><b>7.1 Legacy
Profile</b></a> to see the user-visible differences between the
original VoiceXML 2.1 language and the new Legacy profile. A brief
review of the Basic profile in <a href="#Profile:Basic"><b>7.2
Basic Profile</b></a> would be good as well.</li>
<li>Next you should review <a href="#Framework"><b>4 Core
Concepts</b></a> in detail, since the rest of the language is built
upon the framework described there.</li>
<li><a href="#Resources"><b>5 Resources</b></a> and <a
href="#Modules"><b>6 Modules</b></a> (the semantics part) should be
the bulk of your focus. Remember that they are semantic
descriptions only and that you can implement the functionality any
way you wish as long as the semantics remain the same.</li>
<li>One significant difference from VoiceXML 2.1 is support for DOM
<a href="#Eventing"><b>4.4 Event Model</b></a> .</li>
</ol>
</div>
</div>
<div class="div1">
<h2><a name="DFP" id="DFP" />3 Data Flow Presentation (DFP)
Framework</h2>
<p>Unlike VoiceXML 2.0/2.1, the focus in VoiceXML 3.0 is almost
exclusively on the user interface portions of the language. By
choice, very little work has gone into the development of data
storage and manipulation or control flow capabilities. In short,
VoiceXML 3.0 has been designed from the ground up as a
*presentation* language, according to the definition presented in
the Data Flow Presentation (<a href="#DFP">[DFP]</a>)
Framework.</p>
<p>Although VoiceXML 3.0 is a presentation language, it also
contains within it all 3 levels of the DFP framework ( Figure
6).</p>
<img class="center" src="Images/dfp_architecture.png"
alt="DFP Architecture" />
<p class="caption">Figure 6: DFP Architecture</p>
<p>The Data Flow Presentation (DFP) Framework is an instance of the
Model-View-Controller paradigm, where computation and control flow
are kept distinct from application data and from the way in which
the application communicates with the outside world. This
partitioning of an application allows for any one layer to be
replaced independently of the other two. In addition, it is
possible to simultaneously make use of more than one Data (Model)
language, Flow (Controller), and/or Presentation (View)
language.</p>
<div class="div2">
<h3><a name="Data" id="Data" />3.1 Data</h3>
<p>The Data layer of VoiceXML 3.0 is responsible for maintaining
all presentation-specific information in a format that is easily
accessible and easily editable. Note that the data layer of
VoiceXML 3.0 is very different from the backend data for an
application. Presentation-specific datainformation disappears when
the VoiceXML 3.0 application terminates, while data in the backend
database continues to exist after VoiceXML 3.0 terminates. Examples
of presentation-specific data might include the status of the
dialog in collecting certain information, which prompts have just
been played, and how many of various error conditions have occurred
so far, and the values entered by the user until they are
transmitted to the back-end database or file system.</p>
<p>Within VoiceXML 3.0 the Data layer is realized through a
pluggable data language and a data access or manipulation language.
Access to and use of the data is aligned with options available in
SCXML for simpler interaction with the Flow layer (see the next
section). This specification defines two specific data languages,
XML and ECMAScript, and two data access and manipulation languages,
E4X/DOM and XPath. Others may be defined by implementers.</p>
</div>
<div class="div2">
<h3><a name="DFP:Flow" id="DFP:Flow" />3.2 Flow</h3>
<p>The Flow layer of VoiceXML 3.0 is responsible for all
application control flow, including business logic, dialog
management, and anything else that is not strictly data or
presentation. VoiceXML 3.0 provides primitives that contain the
control flow needed to implement them, but all combinations between
and among the elements at the syntax level is done via calls to
external control flow processors. Two that are likely to be used
with VoiceXML are CCXML and SCXML. Note that flow control
components written outside of VoiceXML may be communicating not
only with a VoiceXML processor but with an HTML browser, a video
game controller, or any of a variety of other input and output
components.</p>
</div>
<div class="div2">
<h3><a name="Presentation" id="Presentation" />3.3
Presentation</h3>
<p>The Presentation layer of VoiceXML 3.0 is responsible for all
interaction with the outside world, i.e., human beings and external
software components. VoiceXML 3.0 *is* the Presentation layer.
Designed originally for human-computer interaction, VoiceXML
"presents" a dialog by accepting audio and dtmf input and producing
audio and video output. All [?] of the modules defined in this
document belong to the VoiceXML 3.0 presentation layer.</p>
</div>
</div>
<div class="div1">
<h2><a name="Framework" id="Framework" />4 Core Concepts</h2>
<div class="div2">
<h3><a name="Descriptions" id="Descriptions" />4.1 Syntactic and
Semantic descriptions</h3>
<p>This document specifies the VoiceXML 3.0 language as a
collection of modules. Each module is described at two levels:</p>
<ol class="enumar">
<li><em>Syntax level</em> -- The syntax is a set of XML elements,
attributes, and events used by VoiceXML 3.0 application developers
to specify applications. The VoiceXML 3.0 elements and attributes
are specified within each module and in the XML schema in appendix
<a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a>. The events
are DOM level 3 events. This document provides a textual
description of each element, attribute, and event.</li>
<li><em>Semantics level</em> -- The semantics of each module is
described in terms of resources, resource controllers, and semantic
events that the resource controllers may generate and consume.
Semantics is described by both UML state chart visual diagrams and
SCXML representations.</li>
</ol>
<p>The visual UML state chart diagrams are informative. They are
included for ease of reading and quick understanding. The more
detailed textual SCXML representations are normative.</p>
<p>It is important to note that this model places no burden or
requirements that a VoiceXML interpreter must implement behavior as
described in the model. Rather, the requirement is that the
behavior must be the same as if it were implemented as described,
but it is permitted to have optimizations or different architecture
behind the implementation of the markup interpretation.</p>
<p>The semantic descriptions are important for reasons including
the following:</p>
<ul>
<li>Enable alternative implementations of a module. The modular
description in this document describes the semantics — "what" a
module does, but not "how" a module is implemented. A module may be
implemented differently on different platforms.</li>
<li>Enable alternative syntax for the semantic description code.
For example, one platform developer might use a particular syntax
for server-based modules, while another platform developer might
use an alternative syntax for an embedded mobile platform.</li>
<li>The same semantic descriptions can be reused in multiple
modules. For example, the semantic description of the <a
href="#PromptModule"><b>6.4 Prompt Module</b></a> can be reused
(referenced) from within the <a
href="#Resources:PromptQueue"><b>5.2 Prompt Queue
Resource</b></a>.</li>
</ul>
</div>
<div class="div2">
<h3><a name="Model.xml" id="Model.xml" />4.2 Resources, Resource
Controllers, and Events</h3>
<p>The resources, resource controllers, and the events they
generate are intended only to describe the semantics of VoiceXML 3
modules. Implementations are not required to use SCXML to implement
VoiceXML 3 modules, nor must they create objects corresponding to
resources, resource controllers, and the SCXML events they
raise.</p>
<p>The logical SCXML events must be distinguished from the
author-visible DOM events that are a mandatory part of the VoiceXML
3 language. Implementations MUST raise these DOM events and process
them in the manner described in <a href="#Eventing"><b>4.4 Event
Model</b></a> . The interaction between actual DOM events and
logical SCXML events is described in <a
href="#DocumentInitialization"><b>4.5 Document Initialization and
Execution</b></a>, below.</p>
<p>Each VoiceXML 3.0 module is described using SCXML notation and
optionally a UML state chart representation of its underlying
behavior expressed in terms of resources and resource controllers.
While the resources and resource controllers are not exposed
directly in the markup, they are used to define the semantics of
VoiceXML 3.0 markup elements. Figure 7 illustrates the relationship
among resource controllers, resources, and media devices. The
arrows represent events exchanged among components. A more concrete
example is represented in Figure 8 which illustrates the Prompt
Resource controller (further defined in <a
href="#PromptModule:Semantics"><b>6.4.2 Semantics</b></a>), the
PromptQueue Resource, and the SSML Media Player.</p>
<img class="center" src="Images/ModelOverview.png"
alt="Semantic model overview" />
<p class="caption">Figure 7: Semantic model with Resources and
Resource Controllers</p>
<img class="center" src="Images/ModelDetail.png"
alt="Semantic model details" />
<p class="caption">Figure 8: Semantic model with Specific
Examples</p>
<div class="div3">
<h4><a name="Framework:Controller"
id="Framework:Controller" />4.2.1 Top Level Controller</h4>
<p>In addition to the Resource Controllers associated with elements
like <form>, there is a top-level controller associated with
the <vxml> element that is responsible for starting
processing and deciding which Resource Controller to execute next
(i.e., for <form> or other interaction element ). The
top-level controller also holds session level properties and is
responsible for returning results to the Flow Level when script
execution terminates.</p>
</div>
</div>
<div class="div2">
<h3><a name="Syntax" id="Syntax" />4.3 Syntax</h3>
<p>VoiceXML 3.0 elements are defined using Schema and represented
in DOM (Level 3).</p>
</div>
<div class="div2">
<h3><a name="Eventing" id="Eventing" />4.4 Event Model</h3>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Open Issue: We really
need to dig in on how the traditional throw/catch from VXML 2.0
work. How does the event handler selection work (complete with
partial event name matching, generic count, best count, cond,
document order, as-if-by-copy, etc.)? All of that has to be
implemented as the default behavior of the vxmlevent event, which
means the vxmlevent needs to be targeted at the right node (the one
that is going to be where the as-if-by-copy occurs) and that the
payload of the vxmlevent needs to include the event name and the
count. We may also want to expose (in JS bindings) the creation of
the list of candidate catch handlers as the algorithm is run.</td>
</tr>
</table>
<div class="div3">
<h4><a name="InternalEvents" id="InternalEvents" />4.4.1 Internal
Events</h4>
<p>The event model for VoiceXML 3.0 builds upon the DOM Level 3
Events <a href="#DOM3Events">[DOM3Events]</a> specification. <a
href="http://www.w3.org/TR/DOM-Level-3-Events/">DOM Level 3
Events</a> offer a robust set of interfaces for managing the
listener registration, dispatching, propagation, and handling of
events, as well as a description of how events flow through an XML
tree.</p>
<p>The DOM 3.0 event model offers VoiceXML developers a rich set of
interfaces that allow them to easily add behavior to their
applications. In addition, conforming to the standard DOM event
model enables authors to integrate their Voice applications in next
generation multimodal or multi-namespaced frameworks such as <a
href="http://www.w3.org/2002/mmi/">MMI</a> and <a
href="http://www.w3.org/2004/CDF/">CDF</a> with minimal efforts.
Note that the VXML 2.0 style events are supported through a new DOM
event named 'vxmlevent', and if this vxmlevent is uncanceled then
the default action is to run the VXML 2.0 event handling.</p>
<p>Within the VoiceXML 3.0 semantic model, the DOM Level 3 Events
APIs are available to all <em>Resource Controllers</em> that have
markup elements associated with them. Indeed, this section covers
the eventing APIs as available to VoiceXML 3.0 markup elements. The
following section describes how the semantic model ties in with the
DOM eventing model.</p>
<div class="div4">
<h5><a name="d3e461" id="d3e461" />4.4.1.1 <cite>Event
Interfaces</cite></h5>
<p>All VoiceXML 3.0 markup elements implement interfaces that
support the following:</p>
<ul>
<li>Subscription to events by event listeners and, symmetrically,
the removal of event listeners.</li>
<li>Publishing of the events emitted by their resources.</li>
<li>Event handling.</li>
</ul>
<div class="div5">
<h6><a name="d3e477" id="d3e477" />4.4.1.1.1
<cite>Event</cite></h6>
<p>The VoiceXML 3.0 Event interface extends the DOM Level 3 <a
href="http://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#interface-Event">
Event</a> interface to support voice specific event information. In
particular, the VoiceXML 3.0 Event interface supports a
<em>count</em> integer that stores the number of times a resources
emits a particular event type. The semantic model manages the
<em>count</em> field by incrementing its value and resetting it as
described in the section that follows.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Open Issue: Because we
now are using the 'vxmlevent' DOM event, we don't need to add a
count to the generic DOM events (and thus change the generic DOM
events). Instead, we need to specify the count as one of the
properties of the vxmlevent event.</td>
</tr>
</table>
</div>
<div class="div5">
<h6><a name="d3e497" id="d3e497" />4.4.1.1.2
<cite>EventTarget</cite></h6>
<p>VoiceXML 3.0 markup elements implement the DOM Level 3 <a
href="http://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#interface-EventTarget">
EventTarget</a> interface.This interface allows registration and
removal of event listeners as well as dispatching of events.</p>
</div>
<div class="div5">
<h6><a name="d3e508" id="d3e508" />4.4.1.1.3
<cite>EventListener</cite></h6>
<p>The VoiceXML 3.0 markup elements implement the DOM Level 3 <a
href="http://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/#interface-EventListener">
EventListener</a> interface. This interface allows the activation
of handlers associated with a particular event. When a listener is
activated, the event handler execution is done in the semantic
model as described in the section that follows.</p>
</div>
</div>
<div class="div4">
<h5><a name="d3e519" id="d3e519" />4.4.1.2 <cite>Event
Flow</cite></h5>
<div class="div5">
<h6><a name="d3e525" id="d3e525" />4.4.1.2.1 <cite>Event Listener
Registration</cite></h6>
<p>The DOM Level 3 Event specification supports the notion of
partial ordering using the <a
href="http://www.w3.org/TR/2006/WD-DOM-Level-3-Events-20060413/events.html#Event-groups">
event listener group</a>; all events within a group are ordered. As
such, in VoiceXML 3.0, event listeners are registered as they are
encountered in the document. Furthermore, all event listeners
registered on an element belong to the same default group. Both of
these provisions ensure that event handlers will execute in
document order.</p>
</div>
<div class="div5">
<h6><a name="d3e536" id="d3e536" />4.4.1.2.2 <cite>Event Listener
Activation</cite></h6>
<p>An event listener is triggered if:</p>
<ol class="enumar">
<li>The type of the event propagating through the markup element
matches the type or category of the event listener.</li>
<li>The event propagation has not been stopped for the listener's
group.</li>
</ol>
<p></p>
<p>Once an event listener is triggered, the execution is handled by
the semantic model as described in the section below. Event
propagation blocks until it is notified by the semantic model to
proceed.</p>
</div>
</div>
</div>
<div class="div3">
<h4><a name="ExternalEvents" id="ExternalEvents" />4.4.2 External
Events</h4>
<p>VoiceXML 3.0 interpreters may receive events from external
sources, for example SCXML engines. In particular, it may receive
the life cycle events specified as part of the Multimodal
Architecture and Interfaces specification <a href="#MMI">[MMI]</a>.
These life cycle events allow the flow component of the DFP
architecture to control the presentation layer by starting and
stopping the processing of markup. By handling these events, the
VoiceXML interpreter acts as a 'modality component' in the
multimodal architecture, while the flow component acts as an
'interaction manager'. As a result, VoiceXML 3 applications can be
easily extended into multimodal applications. However it is
important to note that support for the life cycle events is
required by the DFP framework in all applications, whether uni- or
multimodal.</p>
<p>The interpreter must handle the following life cycle events
automatically:</p>
<ul>
<li>PrepareRequest. This event instructs the interpreter to prepare
to run a VoiceXML script. The event contains: a) either the URI of
the markup to run or the actual markup itself, b) a context ID
which will be used in subsequent messages referring to the same
markup, and c) a specification of media channel to use. Note that
the interpreter does not actually start running the markup in
question when it receives this message. Once the interpreter has
finished its preparation, it sends a PrepareResponse event in
reply. The PrepareResponse event contains the context ID that was
sent in the PrepareRequest plus a status field containing 'success'
or 'failure'. This message with a status of 'success' thus
indicates that the interpreter is now ready to run the specified
markup.</li>
<li>StartRequest. This event instructs the interpreter to run the
specified script. It will contain the same context ID as the
preceding PrepareRequest, and may optionally contain a new
specification of the markup to run and the media channel to use,
overriding those contained in the PrepareRequest. This event may
also be sent without a preceding PrepareRequest. When the
interpreter receives this event, it must start running the
specified markup using the specified media channel. It will then
send a StartResponse event in reply.</li>
<li>CancelRequest with 'immediate' flag set to true. This event
instructs the interpreter to disconnect from the media and to stop
processing the markup. This event contains the context ID. The
interpreter may continue processing clean-up handlers etc. after it
receives this event, but it should not end any events back to the
sender other than the CancelResponse, which acknowledges the
receipt of this command. If the 'immediate' flag is set to false,
the interpreter passes the event up to be handled by author code,
as described below.</li>
<li>ClearContextRequest???</li>
</ul>
<p>All other life cycle events and all other external events are
ignored unless the External Communications Module <a
href="#ExternalCommunicationModule"><b>6.13 External Communication
Module</b></a> is included in the profile. If the External
Communications Module is present, all other external events are
passed up to the application, placed in the application event queue
and then handled as specified by the developer using the
functionality defined in that module.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Open Issue: Should
ClearContextRequest be handled automatically? Should Done be sent
automatically when the document is finished? Where do these
response events get sent?</td>
</tr>
</table>
</div>
</div>
<div class="div2">
<h3><a name="DocumentInitialization"
id="DocumentInitialization" />4.5 Document Initialization and
Execution</h3>
<div class="div3">
<h4><a name="d3e584" id="d3e584" />4.5.1 Initialization</h4>
<p>VoiceXML 3.0 document initialization takes place over two
phases: "DOM Processing" and "Preparation for Execution". Both of
these phases assume the required resources have already been
created. Any errors in the initialization of the document or the
creation of these resources MUST be thrown in the calling context.
If that context was a VoiceXML document, then this MUST be an
error.badfetch.</p>
<p>Note that while these phases are ordered, and the steps within
the phases ordered, this is only a logical ordering.
Implementations are allowed to use a different ordering as long as
behave as if they were following the specified ordering.</p>
<div class="div4">
<h5><a name="d3e591" id="d3e591" />4.5.1.1 DOM Processing</h5>
<p>The first step in initializing a VoiceXML 3.0 document (root
document or child) is generating the Level-3 DOM. This task
involves both checking the document for well formed XML and full
schema and syntax validation to ensure proper tag/attribute
relationships.</p>
<p>Once complete, the interpreter invokes the semantic constructor
for the root <vxml> node in the DOM. In this context, the
term "semantic constructor" represents whatever mechanism is used
to create the Resource Controllers for a given node. No particular
implementation is implied or required. The root <vxml> node
constructor is responsible for invoking the constructors for all
nodes in the document that have them. When it does this, it will
call the semantic constructor routine passing it</p>
<ol class="enumar">
<li>a pointer to the node that has the constructor</li>
<li>a pointer to the root of the DOM</li>
<li>an arbitrary data structure</li>
</ol>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Open Issue: we must specify the operation of the root node
constructor in more detail as part of the V3 specification. Other
people can define modules, but we must specify how they are
assembled into a full semantic representation of the application.)
If there is an application root document specified, the root node
constructor will have to construct its RCs as well, by calling its
root node constructor.</p>
<p>Also, needs to happen after creation of RCs and before general
semantic initialization. After the creation of of the RCs is when
the mapping from syntax to RCs will occur, and that's when the list
would be known.</p>
</td>
</tr>
</table>
<p>Note that the initial construction process creates the RCs but
does not necessarily fully configure them. Further initialization,
including in particular the creation of variables and variable
scopes, will happen only when the RCs are activated at runtime
(e.g. by visiting a Form). However, at this point the list of
children for each element (and thus each RC) is known. For each RC
this list of children will populate into the appropriate place in
the RC data model before semantic initialization of the RC.</p>
<p>Once the RCs are constructed, they are independent of the DOM,
except for the interactions specified below. However, while they
are running the RCs often make use of what appears to be syntactic
information. For example, the concept of 'next item' relies heavily
on document order, while <goto> can take a specific syntactic
label as its target. We provide for this by assuming that RCs can
maintain a shadow copy of relevant syntactic information, where
"shadow copy" is intended to allow a variety of implementations. In
particular, platforms may make an actual copy of the information or
may maintain pointers back into the DOM. The construction process
may create multiple RCs for a given node. In that case, one of the
RCs will be marked as the primary RC. It is the one that will be
invoked when the flow of control reaches that (shadow) node.</p>
</div>
<div class="div4">
<h5><a name="d3e619" id="d3e619" />4.5.1.2 Preparation for
Execution</h5>
<p>If the document being initialized is a child of a root document,
then the root document of that child must fully complete its
initialization before the child can be prepared. In other words,
the root document must both process its DOM and prepare for
execution before child initialization proceeds.</p>
<p>Once in the preparation phase, static properties (ie those NOT a
function of ECMA) are available for lookup. Although this isn't an
explicit step, it is mentioned here as this is the first
opportunity for their retrieval. Note that even if
documentmaxage/stale properties were to be specified in the child
document, they would not be available for retrieval when
downloading the root document. Rather these values would be taken
from the system defaults or context. For example, consider the case
of a first call into a system which lands on a child document
called A. The default values for documentmaxage/stale would be used
when fetching both this child A and root document of the child
called A-root. Should A transition to child document B which
references root B-root, the <property> values of
documentmaxage/stale in A would be used to fetch B. However, the
implicit fetch of B-root would use the system defaults for
documentmaxage/stale.</p>
<p>With the ability to read <property> values comes the first
opportunity to act on any prefetching directives supplied by the
application. Prefetching is an optional step, and could be
postponed temporality or indefinitely. The only requirement on a
conformant processor is that prefetching cannot take place before
this step.</p>
<p>Next, document-level variables and scripts are initialized in
document order. Note that conformant processors MUST not locally
handle any semantic errors generated during this step. Such errors
MUST be thrown to the calling document or context (e.g
error.badfetch). The reason being that the present document is not
yet fully initialized and thus cannot reliably handle errors
locally.</p>
<p>The final step in preparation is for the controller to select
the first <form> to execute. If either the local controller
is malformed or the optional URI fragment points to a non-existent
<form>, an error MUST be generated in the calling document or
context (eg error.badfetch). A conformant processor MUST not handle
this locally.</p>
</div>
</div>
<div class="div3">
<h4><a name="d3e632" id="d3e632" />4.5.2 Execution</h4>
<p>After initialization, the semantic control flow does a
<goto> to the initial Resource Controller. Once a RC is
running, it invokes Resources and other RCs by sending them events.
The DOM is not involved in this process. At various points in the
processing, however, an RC may decide to raise an author-visible
event. It does this by creating an event targeted at a specific DOM
node and sending it back to the DOM. When the DOM receives the
event, it performs the standard bubble/capture cycle with the
target specified in the event. In the course of the bubble/capture
cycle, various event handlers may fire. Their execution is a
semantic action and occurs back in the semantic 'side' of the
environment. The DOM sends messages back to the appropriate
semantic objects to cause this to happen. Note that this means that
the DOM must store some sort of link to the appropriate RCs. The
event handlers may update the data model, execute script, or raise
other DOM events. When the handler finishes processing on the
semantic side, it sends a notification back to the DOM so that it
can resume the bubble/capture phase. (N.B. This notification is NOT
a DOM event.) When the DOM finishes the bubble/capture processing
of the event, it sends a notification back to the RC that raised
the event so that it can continue processing.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Open Issue: Is this
notification a standard semantic event? Note that RC processing
must pause during the bubble/capture phase to avoid concurrency
problems.</td>
</tr>
</table>
<div class="div4">
<h5><a name="d3e640" id="d3e640" />4.5.2.1 Subdialogs</h5>
<p>A subdialog has a completely separate context from the invoking
application. Thus it has a separate DOM and a separate set of RCs.
However it shares the same set of Resources since they are global.
When a subdialog is entered, the Datamodel Resource will have to
create a new scope for the subdialog and hide the calling
document's scopes. When the subdialog is exited, the Datamodel
resource will destroy the subdialog scope(s) and restore the
calling document's scope(s).</p>
</div>
<div class="div4">
<h5><a name="ApplicationRoot" id="ApplicationRoot" />4.5.2.2
Application Root</h5>
<p>To handle event propagation from the leaf application to the
application root document, we create a Document Manager to handle
all communication between the documents. This means that the DOMs
of the two documents remain separate. When an event is not handled
in the leaf document, the Document Manager will propagate it to the
application root, where it will be targeted at the <vxml>
node. Requests to fetch properties or to active grammars will be
handled by the Document Manager in a similar fashion. To handle
platform- and/or language-level defaults, we will create a
"super-root" document above the application root. The Document
Manager will pass it events and requests that are not handled in
the root document. If root and superroot documents do not handle an
event, the Document Manager will ensure that the event is thrown
away.</p>
</div>
<div class="div4">
<h5><a name="d3e650" id="d3e650" />4.5.2.3 Summary of
Syntax/Semantics Interaction</h5>
<p>There seem to be four kinds of interactions between RCs and the
DOM at runtime:</p>
<ol class="enumar">
<li>RCs can inject DOM events into the DOM.</li>
<li>The DOM can invoke the RCs for specific event handlers.</li>
<li>The event handler RCs can signal the DOM when they have
finished processing.</li>
<li>The DOM can signal the emitting RC when it has finished
processing a DOM event.</li>
</ol>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Open Issue: DOM
Modification. There are two possibilities: 1) we can refuse to
allow the DOM to be modified (or ignore the modifications if it is)
2) we can reconstruct the relevant resource controllers when the
DOM is modified. In the latter case, the straightforward approach
would be: a) find the least node that is an ancestor of all the
changes and that has a constructor b) call its constructor as
during initialization, using the current state of the DOM and RCs
as context.</td>
</tr>
</table>
</div>
</div>
<div class="div3">
<h4><a name="d3e667" id="d3e667" />4.5.3 Transition
Controllers</h4>
<p>Transition controllers provide the basis for managing flow in
VoiceXML applications. Resource controllers for some elements like
<form> have associated transition controllers which influence
how form items get selected and executed. In addition to form,
there is a transition controller for each of the following higher
VoiceXML scopes:</p>
<ul>
<li>A document-level transition controller associated with the
<vxml> element's resource controller that is responsible for
starting document processing and deciding which resource controller
to execute next, i.e., for a <form> or other interaction
element in the document.</li>
<li>An application-level transition controller that is responsible
for starting application processing and deciding which
document-level resource controller to execute next.</li>
<li>A top-level or session transition controller that manages the
flow for a VoiceXML session. This top-level transition controller
is responsible for starting session processing and also holds
session level properties.</li>
<li>The above transition controllers influence the selection of the
first form item resource controller to execute, and subsequent ones
through the session.</li>
</ul>
<p>Whenever a form item or form or document finishes execution, the
relevant transition controller is consulted for selecting the
subsequent one for execution. To find the relevant transition
controller, begin at the current resource controller and navigate
along the associated VoiceXML element's parent axis until you reach
a resource controller with an associated transition controller. For
example, for a form item, the parent form's resource controller has
the relevant transition controller.</p>
<p>When a transition controller runs to completion, control is
returned to the next higher transition controller along with any
results that need to be passed up. For example, when the last form
item in a form is filled, the transition controller associated with
the form returns control to the document level transition
controller along with the results for the filled form. Control may
be returned to the parent transition controller in case of such run
to completion semantics as well as error semantics.</p>
</div>
</div>
</div>
<div class="div1">
<h2><a name="Resources" id="Resources" />5 Resources</h2>
<p>This section describes semantic models for common VoiceXML
resources. Resources have a life cycle of creation and destruction.
Specific resources may specify detailed requirements on these
phases. All resources must be created prior to their use by a
VoiceXML interpreter.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Standard lifecycle events
are expected to be defined in later versions: create event: from
idle to created; destroy event: from created to idle.</td>
</tr>
</table>
<p>Resources are defined in terms of a state model and events which
it processes within defined states. Events may be divided into
those which are defined by the resource itself and events defined
by other conceptual entities which the resource receives or sends
within these states. These conceptual entities include resource
controllers and a 'device' which provides an implementation of the
services defined by the resource.</p>
<p>The semantic model is specified in both UML state chart diagrams
and SCXML representations. In case of ambiguity, the SCXML
representation takes precedence over UML diagrams. Note that SCXML
is used here to define the states and events for resources and this
definitional usage should not be confused with the use of SCXML to
specify application flow (see <a href="#DFP:Flow"><b>3.2
Flow</b></a>). Furthermore, these resource events are conceptual,
not DOM events: they are used to define relationship with other
conceptual entities and are not exposed at the markup level.</p>
<p>The following resources are defined: data model (<a
href="#Resources:Datamodel"><b>5.1 Datamodel Resource</b></a>),
prompt queue (<a href="#Resources:PromptQueue"><b>5.2 Prompt Queue
Resource</b></a>), recognition -- DTMF, ASR, and SIV (<a
href="#Resources:Recognition"><b>5.3 Recognition
Resources</b></a>), connection (<a
href="#Resources:Connection"><b>5.4 Connection Resource</b></a>),
and timer (<a href="#Resources:Timer"><b>5.5 Timer
Resource</b></a>).</p>
<div class="div2">
<h3><a name="Resources:Datamodel" id="Resources:Datamodel" />5.1
Datamodel Resource</h3>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Later versions of this document will clarify that different
datamodels may be instanced, such as ECMAScript, XML, etc.
Conformance requirements will be stated at a later stage.</p>
</td>
</tr>
</table>
<p>The datamodel is a repository for both user- and system-defined
data and properties. To simplify variable lookup,we define the
datamodel with a synchronous function-call API, rather than an
asynchronous one based on events. The data model API does not
assume any particular underlying representation of the data or any
specific access language, thus allowing implementations to plug in
different concrete data model languages.</p>
<p>There is a single global data model that is created when the
system is first initialized. Access to data is controlled by means
of scopes, which are stored in a stack. Data is always accessed
within a particular scope, which may be specified by name but
defaults to being the top scope in the stack. At initialization
time, a single scope named "Global" is created. Thereafter scopes
are explicitly created and destroyed by the data model's
clients.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Resource and Resource
controller description to be updated with API calls rather than
events.</td>
</tr>
</table>
<div class="div3">
<h4><a name="Resources:Datamodel:API"
id="Resources:Datamodel:API" />5.1.1 Data Model Resource API</h4>
<a name="DataModelAPI" id="DataModelAPI" />
<table>
<caption>Table 1: Data Model API</caption>
<thead>
<tr>
<td>Function</td>
<td>Arguments</td>
<td>Return Value</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>CreateScope</td>
<td>name(optional)</td>
<td>Success or Failure</td>
<td>Creates a new scope object and pushes it on top of the scope
stack. If no name is provided the scope is anonymous and may be
accessed only when it on the top of the scope stack. A Failure
status is returned if a scope already exists with the specified
name.</td>
</tr>
<tr>
<td>DeleteScope</td>
<td>name(optional)</td>
<td>Success or Failure</td>
<td>Removes a scope from the scope stack. If no name is provided,
the topmost scope is removed. Otherwise the scope with provided
name is removed. A Failure status is returned if the stack is empty
or no scope with the specified name exists.</td>
</tr>
<tr>
<td>CreateVariable</td>
<td>variableName, value(optional), scopeName(optional)</td>
<td>Success or Error</td>
<td>Creates a variable. If scopeName is not specified, the variable
is created in the top most scope on the scope stack. If no value is
provided, the variable is created with the default value specified
by the underlying datamodel. A Failure status is returned if a
variable of the same name already exists in the specified
scope.</td>
</tr>
<tr>
<td>DeleteVariable</td>
<td>variableName, scopeName(optional)</td>
<td>Success or Failure</td>
<td>Deletes the variable with the specified name from the specified
scope. If no scopeName is provided, the variable is deleted from
the topmost scope on the stack. The status Failure is returned if
no variable with the specified name exists in the scope.</td>
</tr>
<tr>
<td>UpdateVariable</td>
<td>variableName, newValue, scopeName(optional)</td>
<td>Success or Failure</td>
<td>Assigns a new value to the variable specified. If scopeName is
not specified, the variable is accessed in the topmost scope on the
stack. A Failure status is returned if the specified variable or
scope cannot be found.</td>
</tr>
<tr>
<td>ReadVariable</td>
<td>variableName, scopeName(optional)</td>
<td>value</td>
<td>Returns the value of the variable specified. If scopeName is
not specified, the variable is accessed in the topmost scope on the
stack. An error is raised if the specified variable or scope cannot
be found.</td>
</tr>
<tr>
<td>EvaluateExpression</td>
<td>expr, scopeName(optional)</td>
<td>value</td>
<td>Evaluates the specified expression and returns its value. If
scopeName is not specified, the expression is evaluated in the
topmost scope on the stack. An error is raised if the specified
scope cannot be found.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="div2">
<h3><a name="Resources:PromptQueue"
id="Resources:PromptQueue" />5.2 Prompt Queue Resource</h3>
<div class="div3">
<h4><a name="PromptQueue:StateChartRepresentation"
id="PromptQueue:StateChartRepresentation" />5.2.1 State Chart
Representation</h4>
<p>Here is a UML representation of the prompt queue. This state
machine assumes that "queue" and "play" are separate commands and
that a separate "play" will always be issued to trigger the play.
When the "play" is issued, the systems plays any queued prompts, up
to and including the first fetch audio in the queue. Then it halts,
even if there are additional prompts or fetch audio in the queue
and waits for another "play" command.</p>
<p>The prompt structure assumed here is fairly abstract. It
consists of a specification of the audio along with optional
parameters controlling playback (for example, speed or volume.) The
audio may be presented in-line, as SSML or some other markup
language, or as a pointer to a file or streaming audio source.
Logically, URLs are dereferenced at the time the prompt is queued,
but implementations are not required to fetch the actual media
until the prompt in question is sent to the player device. Note
that the player device is assumed to be able to handle both
recorded prompts and TTS, and to be able to interpret SSML.
Platforms are free to optimize their implementations as long as
they conform to the state machine specified here. In particular,
platforms may prefetch audio or begin TTS processing in the
background before the prompt is sent to the player device. For
applications that make use of VCR controls (speed up, skip forward,
etc.), actual performance may depend on whether the platform has
implemented such optimizations. For example, a request to skip
forward on a platform that does not prefetch prompts may result in
a long delay. Such performance issues are outside the scope of this
specification.</p>
<p>This diagram assumes that SSML mark information is delivered in
the Player.Done event, and that the player returns a Player.Done
event when it is sent a 'halt' event (otherwise mark information
would get lost on barge-in and hangup, etc).</p>
<p>Note that the "FetchAudio" state is shown stubbed out for
reasons of space, and is expanded in a separate diagram below the
main one.</p>
<img class="center" src="Images/PromptQueueResource.gif"
alt="Semantic model for prompt queue semantics" />
<p>Figure X: Prompt Queue Model</p>
<img class="center" src="Images/PromptQueueResource-FetchAudio.gif"
alt="Semantic model for fetch audio" />
<p>Figure Y: Fetch audio Model</p>
</div>
<div class="div3">
<h4><a name="PromptQueue:SCXMLRepresentation"
id="PromptQueue:SCXMLRepresentation" />5.2.2 SCXML
Representation</h4>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml initialstate="Created">
<datamodel>
<data name="queue"/>
<data name="markName"/>
<data name="markTime"/>
<data name="bargeInType"/>
</datamodel>
<state id="Created">
<initial id="Idle"/>
<transition event="QueuePrompt">
<insert pos="after" loc = "datamodel/data[@name='queue']/prompt" val="_eventData/prompt"/>
</transition>
<transition event="QueueFetchAudio">
<foreach var="node" nodeset="datamodel/data[@name='queue']/prompt">
<if cond="$node[@fetchAudio='true']">
<delete loc="$node"/>
<else>
<assign loc="$node[@bargeInType]" val="unbargeable"/>
</else>
</if>
</foreach>
<insert pos="after" name="datamodel/data[@name='queue']/prompt" val="_eventData/audio"/>
</transition>
<transition event="setParameter">
<send target="player" event="setParameter" namelist="_eventData.paramName, _eventData.newValue"/>
</transition>
<transition event="Cancel" target="Idle">
<send target="player" event="halt"/>
<send event="PlayDone" namelist="/datamodel/data[@name='markName'].text(), /datamodel/data[@name='markTime'].text()"/>
<delete loc="datamodel/data[@name='queue']/prompt"/>
</transition>
<transition event="CancelFetchAudio">
<foreach var="node" nodeset="datamodel/data[@name='queue']/prompt">
<if cond="$node[@fetchAudio='true']">
<delete loc="$node"/>
</if>
</foreach>
</transition>
<state id="Idle">
<onentry>
<assign loc="/datamodel/data[@name='markName']" val=""/>
<assign loc="/datamodel/data[@name='markTime']" val="-1"/>
<assign loc="/datamodel/data[@name='bargeInType']" val=""/>
</onentry>
<transition event="Play" cond="/datamodel/data[@name='queue']/prompt[1][@fetchAudio] eq 'false'" target="PlayingPrompt"/>
<transition event="Play" cond="/datamodel/data[@name='[queue']/prompt[1][@fetchAudio] eq 'true'" target="FetchAudio"/>
</state>
<state id="PlayingPrompt">
<datamodel>
<data name="currentPrompt"/>
</datamodel>
<onentry>
<assign loc="/datamodel/data[@name='currentPrompt']/prompt" val="/datamodel/data[@name='queue']/prompt[1])"/>
<delete loc="/datamodel/data[@name='queue']/prompt[1]"/>
<if cond="/datamodel/data[@name='currentPrompt']/prompt[@bargeInType] != /datamodel/data[@name='bargeInType']">
<send event="BargeInChange" namelist="/datamodel/ data[@name='currentPrompt']/prompt[@bargeInType]"/>
<assign loc="/datamodel/data[@name='bargeInType']" expr="/ datamodel/data[@name='currentPrompt']/prompt[@bargeInType]"/>
</if>
</onentry>
<invoke targettype="player" srcexpr="/datamodel/ data[@name='currentPrompt']/prompt"/>
<finalize>
<if cond="_eventData/MarkTime neq '-1'">
<assign name="/datamodel/data[@name='markName']/" val="_eventData/markName.text()"/>
<assign name="/datamodel/data[@name='markTime']/" val="_eventData/markTime.text()"/>
</if>
</finalize>
<transition event="player.Done" cond="/datamodel/data[@name='queue']/prompt[last()] le '1'" target="Idle">
<send event="PlayDone" namelist="/datamodel/data[@name='markName'].text(), /datamodel/data[@name='markTime'].text()"/>
</transition>
<transition event="player.Done" cond="/datamodel/data[@name='queue'/prompt[1][@fetchAudio] neq 'true'" target="PlayingPrompt"/>
<transition event="player.Done"
cond="/datamodel/data[@name='queue']/prompt[1][@fetchAudio] eq 'true'" target="FetchAudio"/>
</state> <!-- end PlayingPrompt -->
<state id="FetchAudio">
<initial id="WaitFetchAudio"/>
<transition event="player.Done" target="FetchAudioFinal"/>
<state id="WaitFetchAudio">
<onentry>
<send target="self" event="fetchAudioDelay"
delay="/datamodel/data[@name='queue']/prompts[1][@fetchaudiodelay]"/>
</onentry>
<transition event="fetchAudioDelay" next="StartFetchAudio"/>
<transition event="cancelFetchAudio" next="FetchAudioFinal"/>
</state>
<state id="StartFetchAudio">
<datamodel>
<data name="fetchAudio"/>
</datamodel>
<onentry>
<assign loc="/datamodel/data[@name='fetchAudio']" expr="/datamodel/data[@name='queue']/prompts[1]"/>
<delete loc="/datamodel/data[@name='queue']/prompts[1]"/>
<send target="self" event="fetchAudioMin" delay="/datamodel/data[@name='fetchAudio'][@fetchaudiominimum]"/>
<send target="player" event="Play" namelist="/datamodel/data[@name='fetchAudio']"/>
<if cond="/datamodel/data[@name='bargeInType'].text() ne 'fetchAudio'">
<send event="BargeInChange" namelist="fetchAudio"/>
</if>
</onentry>
<transition event="CancelFetchAudio" target="WaitFetchMinimum"/>
<transition event="fetchAudioMin" target="WaitFetchCancel"/>
</state>
<state id="WaitFetchMinimum">
<transition event="fetchAudioMin" target="FetchAudioFinal">
<send target="player" event="halt"/>
</transition>
</state>
<state id="WaitFetchCancel">
<transition event="CancelFetchAudio" target="FetchAudioFinal">
<send target="player" event="halt"/>
</transition>
</state>
<state id="FetchAudioFinal" final="true" />
<!-- could put cleanup handling here -->
</state> <!-- end FetchAudio -->
</state> <!-- end Created -->
</scxml>
</pre>
</div>
</div>
<div class="div3">
<h4><a name="PromptQueue:DefinedEvents"
id="PromptQueue:DefinedEvents" />5.2.3 Defined Events</h4>
<p>The prompt queue resource can be controlled by means of the
following events:</p>
<a name="promptResource:incoming" id="promptResource:incoming" />
<table>
<caption>Table 2: Events received by prompt queue
resource</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>queuePrompt</td>
<td>any</td>
<td>prompt (M), properties(O)</td>
<td>adds prompt to queue, but does not cause it to be played</td>
</tr>
<tr>
<td>queueFetchAudio</td>
<td>any</td>
<td>prompt (M)</td>
<td>adds fetch audio to queue, removing any existing fetch audio
from queue. Does not cause it to be played.</td>
</tr>
<tr>
<td>play</td>
<td>any</td>
<td />
<td>Causes any queued prompts or fetch audio to be played</td>
</tr>
<tr>
<td>changeParameter</td>
<td>any</td>
<td>paramName, newValue</td>
<td>Sets the value of paramName to newValue, which may be either an
absolute or relative value. The new setting takes effect
immediately, even if there is already a prompt playing.</td>
</tr>
<tr>
<td>cancelFetchAudio</td>
<td>any</td>
<td />
<td>Deletes any queued fetch audio. Also cancels any fetch audio
that is already playing, unless fetchAudioMin has been specified
and not yet reached.</td>
</tr>
<tr>
<td>cancel</td>
<td>any</td>
<td />
<td>Immediately cancels any prompt or fetch audio that is playing
and clears the queue.</td>
</tr>
</tbody>
</table>
<p>The prompt queue resource returns the following events to its
invoker:</p>
<a name="promptResource:outbound" id="promptResource:outbound" />
<table>
<caption>Table 3: Events sent by prompt queue resource</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>prompt.Done</td>
<td>controller</td>
<td>markName(O), markTime(O)</td>
<td>Indicates prompt queue has played to completion and is now
empty</td>
</tr>
<tr>
<td>bargeintypeChange</td>
<td>controller</td>
<td>one of: unbargeable, hotword, energy, fetchAudio</td>
<td>sent at start of prompt play and whenever a new prompt or fetch
audio is played whose bargeinType differs from the preceding
one.</td>
</tr>
</tbody>
</table>
<div class="issue">
<p class="prefix"><b>Issue ():</b></p>
<p>Do we need 'fetchAudio' as a distinct bargein type?</p>
<p class="prefix"><b>Resolution:</b></p>
<p>None recorded.</p>
</div>
</div>
<div class="div3">
<h4><a name="d3e939" id="d3e939" />5.2.4 Device Events</h4>
<p>The prompt queue receives the following events from the
underlying player:</p>
<a name="recResource:device-incoming:player"
id="recResource:device-incoming:player" />
<table>
<caption>Table 4: Prompt Queue: Events from Device</caption>
<thead>
<tr>
<td>Event</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>player.Done</td>
<td />
<td>Sent whenever a single prompt or piece of fetch audio finishes
playing.</td>
</tr>
</tbody>
</table>
<p>and sends the following events to the underlying device:</p>
<a name="promptResource:device-outbound"
id="promptResource:device-outbound" />
<table>
<caption>Table 5: Prompt Queue: Events sent to Device</caption>
<thead>
<tr>
<td>Event</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>play</td>
<td>prompt (M)</td>
<td>sent to platform to cause a single prompt to be played.</td>
</tr>
<tr>
<td>setParameter</td>
<td>paramName (M), value(O)</td>
<td>sent to platform to change the value of a playback parameter
such as speed or volume. The new value may be absolute or relative.
The change takes effect immediately.</td>
</tr>
</tbody>
</table>
<p></p>
</div>
<div class="div3">
<h4><a name="d3e990" id="d3e990" />5.2.5 Open Issue</h4>
<div class="issue">
<p class="prefix"><b>Issue ():</b></p>
<p>Differences in PromptQueue Definition: see <a
href="http://www.w3.org/Voice/Group/2005/semmod3/Overview.html#PromptQueueResource">
<cite>Details</cite></a> (members only).</p>
<p class="prefix"><b>Resolution:</b></p>
<p>None recorded.</p>
</div>
</div>
</div>
<div class="div2">
<h3><a name="Resources:Recognition"
id="Resources:Recognition" />5.3 Recognition Resources</h3>
<p>Three types of recognition resources are defined: DTMF
recognition for recognition of DTMF input, ASR recognition for
recognition of speech input, and SIV for speaker identification and
verification. Each recognition resource is associated with a device
which implements their respective recognition services. Each device
represents one or more actual recognizer instances. In case of a
device implemented with multiple recognizers - for example two
different speech recognition engines - it is the responsibility of
the interpreter implementation to ensure that they adhere to the
semantic model defined in this section.</p>
<p>DTMF and ASR recognition resources and SIV resources are
semantically similar. They share the same state and eventing model
as well as recognition processing, timing and result handling.
However, the resources differ in the following respects:</p>
<ul>
<li>Properties: the DTMF resource uses DTMF properties (vxml20,
6.3.3), while the ASR uses speech recognition properties (vxml20,
6.3.2).</li>
<li>Mode: the DTMF resource has the mode value 'dtmf', the ASR
resource has the value 'voice', and the SIV resource has the value
'siv' (vxml20, inputmodes, 6.3.6)</li>
<li>Buffering: only DTMF resource may buffer input when the
resource is not active (e.g. in the FIA transition state, vxml20:
4.1.8).</li>
<li>SIV resources use voice models, not grammars.</li>
</ul>
<p>Otherwise, these resources share the same semantic model.</p>
<p>If a resource controller activates both DTMF and ASR recognition
resources, then that resource controller is responsible for
managing the resources so that only a single recognition result is
produced per recognition cycle. If a resource controller activates
ASR and SIV resources, it may produce multiple results timed to
provide the results within the same cycle or independently.</p>
<div class="div3">
<h4><a name="d3e1018" id="d3e1018" />5.3.1 Definition</h4>
<p>The recognition resource works as follows: in its created state,
grammars (or a voice model) are added to the resource and
subsequently prepared on the device. Recognition with these
grammars (or voice model) can be activated and suspended, and
recognition results are returned.</p>
<p>When the recognition resource is ready to recognize (at least
one active grammar and/or voice model), one or more recognition
cycles may occur in sequence.</p>
<ul>
<li>A recognition cycle is initiated when the resource sends the
device an event instructing it to listen to the input stream.</li>
<li>A recognition cycle is terminated if the device sends the
resource an error event, or the device is instructed to stop
recognition by the resource. When terminated, the device removes
partially or wholly processed input from its buffer, and resource
awaits grammars (and/or voice model) to prepare.</li>
<li>During the recognition cycle, the device may send events to the
resource indicating ongoing recognition status, and recognition
results describing one or more input sequences which match active
grammars (and/or the voice model).</li>
<li>During the recognition cycle, the device may receive
instructions to suspend recognition. When the device is suspended,
input is not buffered and the device must not send any events until
it receives instructions to re-start or terminate recognition.</li>
<li>When the resource receives recognition results from the device
during the recognition cycle, it passes them to its controller. A
recognition cycle is now complete and the resource awaits
instructions either to start another recognition cycle or to
terminate recognition.</li>
</ul>
<p>Thus a recognition resource may enter multiple recognition
cycles (as required for 'hotword' recognition), while requiring
that a device, even if it has multiple instantiations, only
produces one set of recognition results per recognition cycle.</p>
<p>The recognition resource is defined in terms of a data model and
state model.</p>
<p>The data model is composed of the following elements:</p>
<ul>
<li>activeGrammars: an ordered list of grammars with which to
recognize. Each item in the list contains the following
information:
<ul>
<li>content: a URI or inline content to the grammar itself</li>
<li>properties: grammar-specific properties (vxml20: weight, mode,
type, maxage, maxstale, etc)</li>
<li>listener: a resource controller associated with this
grammar</li>
</ul>
</li>
<li>or activeVoiceModel: a voice model with which to perform
verification or identification. It contains the following
information:
<ul>
<li>content: a URI to the voice model</li>
<li>properties: model-specific properties</li>
<li>listener: a resource controller associated with this voice
model</li>
</ul>
</li>
<li>properties: properties pertaining to the recognition process.
These properties differ depending on the type of the recognition
resource: for a DTMF recognition resource, the properties include
DTMF properties; for ASR recognition resource, speech recognition
properties; for SIV resource, SIV properties. The properties may
also include platform-specific properties.</li>
<li>controller: the resource controller to which recognition
status, results and error events are sent.</li>
<li>mode: the recognition resource's inputmode: 'voice' for an ASR
recognition resource, 'dtmf' for a DTMF recognition resource, and
'siv' for an SIV resource.</li>
</ul>
<p></p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>List of properties for active grammars needs to be aligned with
the list of items sent in the AddGrammar event.</p>
</td>
</tr>
</table>
<p>The state model is composed of states corresponding to
functional state: <b>idle</b>, <b>preparing grammars / preparing
voice model</b>, <b>ready to recognize</b>, <b>recognizing</b>,
<b>suspended recognition</b> and <b>waiting for results</b>.</p>
<p>In the idle state, the resource awaits events from resource
controllers to activate grammars or a voice model for recognition
on the device. The data model - activeGrammars or activeVoiceModel,
properties, controller and mode - is (re-)initialized upon entry to
this state: activeGrammars and activeVoiceModel are cleared,
properties and controllers are set to null. If the resource
receives an 'addGrammar' event, a new item is added to
activeGrammars using grammar, properties and listener data in the
event payload. If the resource receives a 'prepare' event, it
updates its data model with event data: 'properties' with the
properties event data and 'controller' is updated with the
controller event data. Subsequent event notifications and responses
are sent to the resource controller identified as the 'controller'.
The recognition resource then moves into the <b>preparing
grammars</b> (or <b>preparing voice model</b>) state.</p>
<p>In the <b>preparing grammars</b> state, the resource behavior
depends on whether activeGrammars is empty or not. If
activeGrammars is empty (i.e. no active grammars are defined for
this recognition resource), the resource sends the controller a
'notPrepared' event and returns to the <b>idle</b> state. If
activeGrammar is non-empty, the resource sends a 'prepare' event to
the device. The event payload includes 'grammars' and 'properties'
parameters. The 'grammars' value is an ordered list where each list
item is a grammar's content and its properties extracted from
activeGrammars. The order of grammars in the 'grammars' parameter
must follow the order in the activeGrammar data model. If the
device sends a 'prepared' event, the resource sends a 'prepared'
event to the controller and transitions into the <b>ready to
recognize</b> state.</p>
<p>In the <b>preparing voice models</b> state, the resource
behavior depends on whether activeVoiceModel is empty or not. If
activeVoiceModel is empty (i.e. voice model is not defined for this
resource), the resource sends the controller a 'notPrepared' event
and returns to the <b>idle</b> state. If activeVoiceModel is
non-empty, the resource sends a 'prepare' event to the device. The
event payload includes 'voicemodel' and 'properties' parameters.
The 'voicemodel' value is a URI to the voicemodel, and its
properties are extracted from activeVoiceModel. If the device sends
a 'prepared' event, the resource sends a 'prepared' event to the
controller and transitions into the <b>ready to recognize</b>
state.</p>
<p>When the recognition resource is in a ready to recognize state,
it may receive a 'stop' event. In this case, the resource sends a
'stop' event to the device, and returns to the <b>idle</b> state.
If the resource receives a 'listen' event, it sends a 'listen'
event to the device and moves into the <b>recognizing
state</b>.</p>
<p>When the resource is in a <b>recognizing state</b>, it can
toggle between this state and a <b>suspended recognizing</b> state.
If the resource receives a 'suspend' event, then it moves into the
<b>suspended recognizing</b> state and sends the device a 'suspend'
event which causes the device to suspend recognition and delete any
buffered input. No input is buffered while the device is in a
suspended state. If the resource then receives a 'listen' event, it
moves back into the <b>recognizing state</b>.</p>
<p>When in the <b>recognizing state</b>, the resource may receive
an 'inputStarted' event from the device, indicating that user input
has been detected. The resource then moves into a <b>waiting for
results</b> state. The device may send an 'error' event (for
example, if maximum time has been exceeded) causing it to return to
the <b>idle state</b> and send the controller an 'error' event.
Alternatively, the device may send a 'recoResults' event, which
contains a results parameter, a data structure representing
recognition results. In the case of DTMF or ASR, the results can be
in VoiceXML 2.0 or EMMA format. For SIV, the results must be in
EMMA format. The structure may contain zero or more recognition
results. Each result must specify the grammar (or voicemodel)
associated with the recognition (using the same grammar/voicemodel
name as used in the payload of the 'prepare' event), its
recognition confidence and its input mode. The resource sends its
controller a 'recoResults' event with event data containing the
device's results parameter together with a listener parameter whose
value is the listener associated with the grammar of the first
result with the highest confidence (if there are no results, then
the listener parameter is not defined). The resource then returns
to the ready to <b>recognize state</b>, awaiting either a 'stop'
event to terminate recognition or a 'listen' event to start another
recognition cycle using the same active grammars and recognition
properties.</p>
</div>
<div class="div3">
<h4><a name="d3e1159" id="d3e1159" />5.3.2 Defined Events</h4>
<p>A recognition resource is defined by the events it receives:</p>
<a name="recResource:incoming" id="recResource:incoming" />
<table>
<caption>Table 6: Events received by recognition resource</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>addGrammar</td>
<td>any</td>
<td>grammar (M), listener (M), properties (O)</td>
<td>creates a grammar item composed of the grammar, listener and
properties, and adds it to the activeGrammars</td>
</tr>
<tr>
<td>addVoiceModel</td>
<td>any</td>
<td>voicemodel (M), listener (M), properties (O)</td>
<td>creates a VoiceModel item composed of the voice model, listener
and properties, and adds it to the activeVoiceModel</td>
</tr>
<tr>
<td>prepare</td>
<td>any</td>
<td>controller (M), properties (M)</td>
<td>prepares the device for recognition using activeGrammars or
activeVoiceModel and properties</td>
</tr>
<tr>
<td>listen</td>
<td>any</td>
<td />
<td>initiates/resumes recognition</td>
</tr>
<tr>
<td>suspend</td>
<td>any</td>
<td />
<td>suspends recognition</td>
</tr>
<tr>
<td>stop</td>
<td>any</td>
<td />
<td>terminates recognition</td>
</tr>
</tbody>
</table>
<p>and the events it sends:</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Need to add a prepareGrammar event (from the grammar RC).</p>
</td>
</tr>
</table>
<a name="recResource:outbound" id="recResource:outbound" />
<table>
<caption>Table 7: Events sent by recognition resource</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Sequencing</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>prepared</td>
<td>controller</td>
<td />
<td>one-of: prepared, notPrepared</td>
<td>positive response to prepare (activeGrammars or
activeVoiceModel prepared)</td>
</tr>
<tr>
<td>notPrepared</td>
<td>controller</td>
<td />
<td>one-of: prepared, notPrepared</td>
<td>negative response to prepare (no activeGrammars or
activeVoiceModel defined)</td>
</tr>
<tr>
<td>inputStarted</td>
<td>controller</td>
<td />
<td />
<td>notification that onset of input has been detected</td>
</tr>
<tr>
<td>inputFinished</td>
<td>controller</td>
<td />
<td />
<td>notification that the end of input has been detected</td>
</tr>
<tr>
<td>partialResult</td>
<td>controller</td>
<td>results (M), listener (O)</td>
<td />
<td>notification of a partial recognition result</td>
</tr>
<tr>
<td>recoResult</td>
<td>controller</td>
<td>results (M), listener (O)</td>
<td />
<td>notification of complete recognition result, including the
results structure and a listener</td>
</tr>
<tr>
<td>error</td>
<td>controller</td>
<td>error status (M)</td>
<td />
<td>notification that an error has occurred</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="d3e1321" id="d3e1321" />5.3.3 Device Events</h4>
<p>The resource receives from the recognition device the following
events:</p>
<a name="recResource:device-incoming:recognition"
id="recResource:device-incoming:recognition" />
<table>
<caption>Table 8: Recognition: Events from Device</caption>
<thead>
<tr>
<td>Event</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>prepared</td>
<td />
<td>response to prepare indicating that activeGrammars or
activeVoiceModel have been successfully prepared</td>
</tr>
<tr>
<td>inputStarted</td>
<td />
<td>notification that the onset of input has been detected</td>
</tr>
<tr>
<td>inputFinished</td>
<td />
<td />
<td>notification that the end of input has been detected</td>
</tr>
<tr>
<td>partialResults</td>
<td>results (M)</td>
<td>notification of a partial recognition results</td>
</tr>
<tr>
<td>recoResults</td>
<td>results (M)</td>
<td>notification of final recognition results</td>
</tr>
<tr>
<td>error</td>
<td>error status (M)</td>
<td>an error occurred</td>
</tr>
</tbody>
</table>
<p>and sends to the recognition device the following events:</p>
<a name="recResource:device-outbound"
id="recResource:device-outbound" />
<table>
<caption>Table 9: Recognition: Events sent to Device</caption>
<thead>
<tr>
<td>Event</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>prepare</td>
<td>grammars (M) or voicemodel (M), properties (M)</td>
<td>the recognition or SIV device is prepared with grammars and
properties</td>
</tr>
<tr>
<td>clear</td>
<td />
<td>all grammars and properties in the recognition device are to be
cleared</td>
</tr>
<tr>
<td>listen</td>
<td />
<td>recognition is to be initiated</td>
</tr>
<tr>
<td>suspend</td>
<td />
<td>recognition is to be suspended</td>
</tr>
<tr>
<td>stop</td>
<td />
<td>recognition is to be stopped</td>
</tr>
</tbody>
</table>
<p></p>
</div>
<div class="div3">
<h4><a name="d3e1423" id="d3e1423" />5.3.4 State Chart
Representation</h4>
<p>The state model for an ASR recognition resource are shown in
Figure 9. The DTMF resource model only differs in that the value
for the mode data is 'dtmf' instead of 'voice'.</p>
<p>[generalize stop event returning resource to idle state ...]</p>
<img class="center" src="Images/recognizer.png"
alt="Recognition Resource States" />
<p class="caption">Figure 9: Recognition Resource States</p>
</div>
<div class="div3">
<h4><a name="d3e1435" id="d3e1435" />5.3.5 SCXML
Representation</h4>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml initialstate="Created">
<datamodel>
<data name="activeGrammars"/>
<data name="properties"/>
<data name="controller"/>
<data name="mode"/>
</datamodel>
<state id="Created">
<initial id="idle"/>
<state id="idle">
<onentry>
<foreach var="node" nodeset="datamodel/data[@name='activeGrammars']">
<delete loc="$node"/>
</foreach>
<assign loc="/datamodel/data[@name='properties']" val="null"/>
<assign loc="/datamodel/data[@name='controller']" val="null"/>
<assign loc="/datamodel/data[@name='mode']" val="voice"/>
</onentry>
<transition event="AddGrammar">
<datamodel>
<data name = "gram"/>
</datamodel>
<assign name="/datamodel/data/[@name='gram']/grammar" expr="_eventData/grammar" />
<assign name="/datamodel/data/[@name='gram']/properties" expr="_eventData/properties" />
<assign name="/datamodel/data/[@name='gram']/listener" expr="_eventData/listener" />
<insert pos="after" name="datamodel/data[@name='activeGrammars']" val="gram"/>
</transition>
<transition event="prepare" target="preparingGrammars">
<assign loc="/datamodel/data[@name='properties']" expr="_eventData/properties"/>
<assign loc="/datamodel/data[@name='controller']" expr="_eventData/controller"/>
</transition>
</state> <!-- end idle -->
<state id="preparingGrammars">
<onentry>
<if cond="isEmpty(/datamodel/data[@name='activeGrammars']) eq 'false'">
<send target="device" event="dev:clear"/>
<send target="device" event="dev:prepare" namelist="/datamodel/data[@name='activeGrammars'], /datamodel/data[@name='properties']"/>
</if>
</onentry>
<transition cond="isEmpty(/datamodel/data[@name='activeGrammars']) eq 'true'" target="idle">
<send target="controller" event="notPrepared"/>
</transition>
<transition event="stop" target="idle">
<send target="device" event="dev:stop"/>
</transition>
<transition event="dev:prepared" target="readyToRecognize">
<send target="controller" event="Prepared"/>
</transition>
</state> <!-- end preparingGrammars -->
<state id="readyToRecognize">
<transition event="listen" target="recognizing" />
<transition event="stop" target="idle">
<send target="device" event="dev:stop"/>
</transition>
</state> <!-- end readyToRecognize -->
<state id="recognizing">
<onentry>
<send target="device" event="dev:listen"/>
</onentry>
<transition event="suspend" target="suspendedRecognizing"/>
<transition event="dev:inputStarted" target="waitingForResult"/>
<transition event="stop" target="idle">
<send target="device" event="dev:stop"/>
</transition>
</state> <!-- end recognizing -->
<state id="suspendedRecognizing">
<onentry>
<send target="device" event="dev:suspend"/>
</onentry>
<transition event="listen" target="recognizing"/>
<transition event="stop" target="idle">
<send target="device" event="dev:stop"/>
</transition>
</state> <!-- end suspendedRecognizing -->
<state id="waitingForResult">
<onentry>
<send target="controller" event="inputStarted"/>
</onentry>
<transition event="dev:inputFinished">
<send target="controller" event="inputFinished"/>
</transition>
<transition event="dev:partialResult">
<send target="controller" event="partialResult" namelist="_eventData/results,_eventData/grammar/listener"/>
</transition>
<transition event="dev:recoResults" target="readyToRecognize">
<send target="controller" event="recoResult" namelist="_eventData/results,_eventData/grammar/listener"/>
</transition>
<transition event="dev:error" target="idle">
<send target="controller" event="error" namelist="_eventData/error status"/>
</transition>
<transition event="stop" target="idle">
<send target="device" event="dev:stop"/>
</transition>
</state> <!-- end waitForResult -->
</state> <!-- end Created -->
</scxml>
</pre>
</div>
</div>
</div>
<div class="div2">
<h3><a name="Resources:Connection" id="Resources:Connection" />5.4
Connection Resource</h3>
<div class="div3">
<h4><a name="ConnectionResource:Definition"
id="ConnectionResource:Definition" />5.4.1 Definition</h4>
<p>A connection resource is an entity that establishes/relinquishes
a connection between the VoiceXML interpreter context and the user.
It can be used by the interpreter context to establish a connection
with the user at the start of the dialog or to disconnect an
existing connection either implicitly (when there are no more
elements to execute in the VoiceXML application) or explicitly
(when the interpreter context encounters a <disconnect>
element or the user chooses to terminate the call).</p>
</div>
<div class="div3">
<h4><a name="ConnectionResource:FinalProcessing"
id="ConnectionResource:FinalProcessing" />5.4.2 Final Processing
State</h4>
<p>Whenever an interpreter context disconnects from the user, the
interpreter context may enter into the final processing state as is
the case while executing a <disconnect> element or when the
user actively disconnects. The purpose of this state is to allow
the VoiceXML application to perform any necessary final cleanup,
such as submitting information to the application server. In this
state, entering into the wait state is not allowed. However, the
application can navigate from one page to another without trying to
interact with the user. Therefore, the application should not enter
<field>, <record> or <transfer> during the final
processing state. The VoiceXML interpreter must exit if the
VoiceXML application attempts to enter the waiting state while in
the final processing state.</p>
<p>Aside from this restriction, execution of the VoiceXML
application continues normally while in the final processing state.
Thus for example the application may transition between documents
while in the final processing state, and the interpreter must exit
if no form item is eligible to be selected.</p>
</div>
<div class="div3">
<h4><a name="d3e1455" id="d3e1455" />5.4.3 Defined Events</h4>
<a name="ConnectionResource:Incoming"
id="ConnectionResource:Incoming" />
<table>
<caption>Table 10: Events Received by Connection Resource</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>prepare</td>
<td />
<td />
<td>Prepare to connect the user with the interpreter context</td>
</tr>
<tr>
<td>connect</td>
<td />
<td />
<td>Connect the user to the interpreter context</td>
</tr>
<tr>
<td>disconnect</td>
<td>any</td>
<td />
<td>Disconnect the user from the interpreter context</td>
</tr>
</tbody>
</table>
<a name="ConnectionResource:outbound"
id="ConnectionResource:outbound" />
<table>
<caption>Table 11: Events Sent by Connection Resource</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>prepared</td>
<td />
<td />
<td>Connection prepared</td>
</tr>
<tr>
<td>connected</td>
<td />
<td />
<td>Interpreter context connected to the user</td>
</tr>
<tr>
<td>disconnected</td>
<td>Any</td>
<td />
<td>Interpreter context disconnected from the user</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="d3e1530" id="d3e1530" />5.4.4 State Chart
Representation</h4>
<p>[TBD]</p>
</div>
<div class="div3">
<h4><a name="d3e1536" id="d3e1536" />5.4.5 SCXML
Representation</h4>
<p>[TBD]</p>
</div>
</div>
<div class="div2">
<h3><a name="Resources:Timer" id="Resources:Timer" />5.5 Timer
Resource</h3>
<div class="div3">
<h4><a name="d3e1545" id="d3e1545" />5.5.1 Definition</h4>
<p>The timer resource is a resource that tracks timers for various
resource controllers. A timer can be set to send a timeout event at
some future time. Timers which have been set may also be
canceled.</p>
</div>
<div class="div3">
<h4><a name="d3e1550" id="d3e1550" />5.5.2 Defined Events</h4>
<p>A timer resource is defined by the events it receives:</p>
<a name="timerResource:incoming" id="timerResource:incoming" />
<table>
<caption>Table 12: Events received by timer resource</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>start</td>
<td>any</td>
<td>owner (M), timeout (M), handle (O)</td>
<td>The effect of sending a start event to the timer resource will
have a new timer started that in timeout time will fire a
timerExpired event to the owner of the event. The handle must be
used to correlate timers if the cancel is supported.</td>
</tr>
<tr>
<td>cancel</td>
<td>any</td>
<td>owner (M), handle (O)</td>
<td>The cancel event will cancel any previous timeout that has been
set with the timer resource that match the handle and owner. If
there was no previous event set (or the previous timer has fired)
then cancel still succeeds, as the semantics of cancel are once
cancel has succeed you will not receive a timerExpired event</td>
</tr>
</tbody>
</table>
<p>and the events it sends:</p>
<a name="timerResource:outbound" id="timerResource:outbound" />
<table>
<caption>Table 13: Events sent by timer resource</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Sequencing</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>timerExpired</td>
<td>controller</td>
<td>handle (O)</td>
<td>timerExpired must precede any cancelSuccess</td>
<td>This event means the timer has fired. The controller that
receives the event is the owner of the start event. If the handle
was passed in to the start event then it will be passed back when
the timer expires</td>
</tr>
<tr>
<td>cancelSuccess</td>
<td>controller</td>
<td>handle (O)</td>
<td>timerExpired must precede any cancelSuccess</td>
<td>This event means that the timer in question is canceled and no
new timerExpired events may be received</td>
</tr>
</tbody>
</table>
<p>t is possible to receive both a timerExpired event and then a
cancelSuccess event as the events may have crossed paths.</p>
</div>
<div class="div3">
<h4><a name="d3e1629" id="d3e1629" />5.5.3 Device Events</h4>
<p>The resource receives from the timer device the following
events:</p>
<a name="timerResource:device-incoming"
id="timerResource:device-incoming" />
<table>
<caption>Table 14: Timer: Events from Device</caption>
<thead>
<tr>
<td>Event</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td />
<td />
<td /></tr>
</tbody>
</table>
<p>and sends to the timer device the following events:</p>
<a name="timerResource:device-outbound"
id="timerResource:device-outbound" />
<table>
<caption>Table 15: Recognition: Events sent to Device</caption>
<thead>
<tr>
<td>Event</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td />
<td />
<td /></tr>
</tbody>
</table>
<p></p>
</div>
<div class="div3">
<h4><a name="d3e1668" id="d3e1668" />5.5.4 State Chart
Representation</h4>
<p>TBD</p>
</div>
</div>
</div>
<div class="div1">
<h2><a name="Modules" id="Modules" />6 Modules</h2>
<p>In VoiceXML 3.0, the language is partitioned into independent
modules which can be combined in various ways. In addition to the
modules defined in this section, it is also possible for third
parties to define their own modules (see Section XXX).</p>
<p>Each module is assigned a schema, which defines its syntax, plus
one or more Resource Controllers (RCs), which define its semantics,
plus a "constructor" that knows how to create them from the
syntactic representation at initialization time. Only DOM nodes
that have schemas and constructors (and hence RCs) assigned to them
can be modules in VoiceXML 3.0. However, we may choose to define
constructors and RCs for nodes that are not modules. Nodes that do
not have constructors and RCs ultimately depend on some module for
their interpretation. (Those modules are usually ancestor nodes,
but we do not require this.) There can be multiple modules
associated with the same VoiceXML element. They may set properties
differently, add different child elements, etc. In many cases, some
of the modules will be extensions of the others, but we don't
require this.</p>
<p>Note there is not necessarily a one-to-one relationship between
semantic RCs and syntactic markup elements. It may take several RCs
to implement the functionality of a single markup element.</p>
<div class="div2">
<h3><a name="Grammar:GrammarModule"
id="Grammar:GrammarModule" />6.1 Grammar Module</h3>
<p>This module describes the syntactic and semantic features of a
<grammar> element which defines grammars used in ASR and DTMF
recognition. Grammars defined via this module are used by other
modules.</p>
<p>The attributes and content model of <grammar> are
specified in <a href="#GrammarModule:Syntax"><b>6.1.1
Syntax</b></a>. Its semantics are specified in <a
href="#GrammarModule:Semantics"><b>6.1.2 Semantics</b></a>.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Issue: Grammar processing will need to know the Base URI to
resolve relative references.</p>
</td>
</tr>
</table>
<div class="div3">
<h4><a name="GrammarModule:Syntax"
id="GrammarModule:Syntax" />6.1.1 Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<div class="div4">
<h5><a name="d3e1706" id="d3e1706" />6.1.1.1 Attributes</h5>
<p>The <grammar> element has the attributes specified in
Table 16, in addition to the fetchtimeout, fetchhint, maxage, and
maxstale attributes as specified in <a href="#Fetching"><b>8.1.1
Fetching</b></a>.</p>
<a name="grammar:attributes" id="grammar:attributes" />
<table>
<caption>Table 16: <grammar> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>mode</th>
<td>The only allowed values are "voice" and "dtmf"</td>
<td>Defines the mode of the grammar following the modes of the W3C
Speech Recognition Grammar Specification <a
href="#SRGS">[SRGS]</a>.</td>
<td>No</td>
<td><em>The value of the document property "grammarmode"</em></td>
</tr>
<tr>
<th>weight</th>
<td>Weights are simple positive floating point values without
exponentials. Legal formats are "n", "n.", ".n" and "n.n" where "n"
is a sequence of one or many digits.</td>
<td>Specifies the weight of the grammar. See vxml2: <a
href="http://www.w3.org/TR/2004/REC-voicexml20-20040316/#dml3.1.1.3">
Section 3.1.1.3</a></td>
<td>No</td>
<td>1.0</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>The default value of the "grammarmode" document property (see
XXXX) is "voice".</p>
</td>
</tr>
</table>
<h5><a name="d3e1758" id="d3e1758" />6.1.1.2 Content Model</h5>
<p>The content model of <grammar> consists of exactly one
of:</p>
<ul>
<li>the <grammar> element (from the
http://www.w3.org/2001/06/grammar namespace; see <a
href="#Grammar:InlineSRGSGrammarModule"><b>6.2 Inline SRGS Grammar
Module</b></a>), or</li>
<li>the <externalgrammar> element (see <a
href="#Grammar:ExternalGrammarModule"><b>6.3 External Grammar
Module</b></a>)</li>
</ul>
</div>
</div>
<div class="div3">
<h4><a name="GrammarModule:Semantics"
id="GrammarModule:Semantics" />6.1.2 Semantics</h4>
<p>The grammar RC is the primary RC for the <grammar>
element.</p>
<div class="div4">
<h5><a name="d3e1783" id="d3e1783" />6.1.2.1 Definition</h5>
<p>The grammar RC is defined in terms of a data model and state
model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this grammar RC</li>
<li>properties: weight attribute value, fetchtimeout, maxage,
maxstale, charset, encoding, and language</li>
<li>mode: mode</li>
<li>fetchhint: fetchhint</li>
</ul>
<p></p>
<p>The grammar RC's state model consists of the following states:
Idle, Initializing, Ready, and Executing.</p>
<p>While in the Idle state, the RC may receive an 'initialize'
event, whose 'controller' event data is used to update the data
model. The RC then transitions into the Initializing state.</p>
<p>In the Initializing state, the grammar RC first initializes its
child.</p>
<ul>
<li>The values of the fetchtimeout attribute and the
grammarfetchtimeout property (**REF**) are used to determine the
fetchtimeout property value according to section XXXX.</li>
<li>The values of the maxage attribute and the grammarmaxage
property (**REF**) are used to determine the maxage property value
according to section XXXX.</li>
<li>The values of the maxstale attribute and the grammarmaxstale
property (**REF**) are used to determine the maxstale property
value according to section XXXX.</li>
<li>The values of the fetchhint attribute and the grammarfetchhint
property (**REF**) are used to determine the fetchhint parameter
value according to section XXXX.</li>
</ul>
<p>Next, the language, charset, and encoding parameters are set to
the values in effect at this point in the document. If the
fetchhint parameter value is "Prefetch", the RC sends the Prefetch
event to the DTMF or ASR Recognizer resource, as appropriate (see
below), with the following data: the child RC, fetchtimeout,
maxage, maxstale. Finally, the RC sends the controller an
'initialized' event and transitions to the Ready state.</p>
<p>In the Ready state, when the grammar RC receives an 'execute'
event it transitions to the Executing state.</p>
<p>In the Executing state,</p>
<ul>
<li>The values of the fetchtimeout attribute and the
grammarfetchtimeout property (**REF**) are used to determine the
fetchtimeout property value according to section XXXX.</li>
<li>The values of the maxage attribute and the grammarmaxage
property (**REF**) are used to determine the maxage property value
according to section XXXX.</li>
<li>The values of the maxstale attribute and the grammarmaxstale
property (**REF**) are used to determine the maxstale property
value according to section XXXX.</li>
</ul>
<p>If the child RC is an External Grammar, the grammar RC sends an
'execute' event to the child RC and waits for it to complete.</p>
<p>Then, the grammar RC sends an AddGrammar event to the DTMF
Recognizer Resource if mode="dtmf" or to the ASR Recognizer
Resource if mode="voice", with the following as event data: the
child RC, the fetchhint, language, charset, and encoding parameter
values, and the controller RC (e.g., link, field, or form) as the
handler for recognition results.</p>
<p>Finally, the grammar RC sends the controller an executed event
and transitions to the Ready state.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>The currently-active value of fetchhint, fetchtimeout, maxage,
and maxstale properties may be different at execution than at
initialization, so the determination of these values should be done
by the RCs that initialize or execute the grammar RC rather than by
the grammar RC itself. The document text needs to be updated to
reflect this. (From Nov 2009 f2f)</p>
<p>Initializing: Validate that behavior of sending a pointer to the
child RC to the ASR resource. Is this acceptable, or do we need to
extract the grammar data from the child RC and then send that data?
The advantage of sending the RC pointer is that it makes clear what
kind of grammar info it is -- inline SRGS or external
reference.</p>
<p>Execute issues:</p>
<ul>
<li>Note that a mismatch between the "mode" attribute value and any
mode param returned in the media type cannot be detected at this
stage because the document hasn't been fetched yet.</li>
<li>Still need to add a 'cond' capability as we have for
prompts.</li>
<li>Should we allow explicit scope indication a la VoiceXML 2's
"scope" attribute? How do we handle document-scoped grammars
defined syntactically at a lower level? In this case should the
handler be the controller RC or the controller for the document?
Which RC actually executes the grammar RC?</li>
<li>How does 'as if by copy' change this for <link>
grammars?</li>
</ul>
<p />
<p>Editor will write new section 4.5 "Other" and subsections 4.5.1
"property/attribute resolution" and 4.5.2 "language resolution".
Depending on the text, we may need to update the semantics to refer
to section 4.5.2 when describing how xml:lang is used.</p>
</td>
</tr>
</table>
</div>
<div class="div4">
<h5><a name="d3e1861" id="d3e1861" />6.1.2.2 Defined Events</h5>
<p>The Grammar RC is defined to receive the following events:</p>
<table border="1">
<caption>Table 17: Events received by Grammar RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialize</td>
<td>any</td>
<td>controller(M)</td>
<td>causes the element and its children to be initialized</td>
</tr>
<tr>
<td>execute</td>
<td>controller</td>
<td>Adds the grammar to the appropriate Recognition Resource</td>
<td></td>
</tr>
</tbody>
</table>
<p>and the events it sends:</p>
<table border="1">
<caption>Table 18: Events sent by Grammar RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialized</td>
<td>controller</td>
<td />
<td>response to initialize event indicating that it has been
successfully initialized</td>
</tr>
<tr>
<td>executed</td>
<td>controller</td>
<td />
<td>response to execute event indicating that it has been
successfully executed</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e1930" id="d3e1930" />6.1.2.3 External Events</h5>
<p>The external events sent and received by the Grammar RC are
those defined in this table:</p>
<a name="grammar:external-events" id="grammar:external-events" />
<table>
<caption>Table 19: Grammar RC External Events</caption>
<tbody>
<tr>
<td>Event</td>
<td>Source</td>
<td>Target</td>
<td>Description</td>
</tr>
<tr>
<td>addGrammar</td>
<td>GrammarRC</td>
<td>DTMF Recognition Resource or ASR Recognition Resource</td>
<td>Adds grammar to list of currently active grammars</td>
</tr>
<tr>
<td>Prefetch</td>
<td>GrammarRC</td>
<td>DTMF Recognition Resource or ASR Recognition Resource</td>
<td>Requests that the grammar be fetched/compiled in advance, if
possible</td>
</tr>
</tbody>
</table>
<p> </p>
</div>
<div class="div4">
<h5><a name="d3e1968" id="d3e1968" />6.1.2.4 State Chart
Representation</h5>
</div>
<div class="div4">
<h5><a name="d3e1971" id="d3e1971" />6.1.2.5 SCXML
Representation</h5>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml initialstate="Created">
<datamodel>
<data id="controller"/>
<data id="child"/>
<data id="content"/> <!-- not used -->
<data id="properties"/>
<data id="mode"/>
<data id="fetchhint"/>
</datamodel>
<state id="Created">
<initial id="Idle"/>
<state id="Idle">
<onentry>
<!-- ISSUE: Is this needed? -->
<assign location="$controller" expr="null"/>
<assign location="$child" expr="null"/>
<assign location="$content" expr="null"/>
<assign location="$properties/weight" expr="1.0"/>
<assign location="$properties/fetchtimeout"/>
<assign location="$properties/maxage"/>
<assign location="$properties/maxstale"/>
<assign location="$properties/charset"/>
<assign location="$properties/encoding"/>
<assign location="$properties/language"/>
<assign location="$mode"/>
<assign location="$fetchhint"/>
</onentry>
<transition event="initialize" target="Initializing">
<assign name="$controller" expr="_eventData/controller"/>
<assign name="$child" expr="_eventData/child"/>
</transition>
</state> <!-- end Idle -->
<state id="Initializing">
<onentry>
<!-- ISSUE: complete the initialization -->
<assign location="$properties/weight" expr="1.0"/>
<assign location="$properties/fetchtimeout" expr="InitDefault();"/>
<assign location="$properties/maxage" expr="InitDefault();"/>
<assign location="$properties/maxstale" expr="InitDefault();"/>
<assign location="$properties/charset" expr="InitDefault();"/>
<assign location="$properties/encoding" expr="InitDefault();"/>
<assign location="$properties/language" expr="InitDefault();"/>
<assign location="$mode" expr="InitDefault();"/>
<assign location="$fetchhint" expr="InitDefault();"/>
<send target="$child/controller" event="initialize"
namelist="$child"/>
</onentry>
<transition event="Initializing.error" target="Idle">
<send target="controller" event="initialize.error"
namelist="_eventData/error_status"/>
</transition>
<transition event="Initializing.done" target="Ready">
<if cond="$fetchhint eq 'prefetch'">
<if cond="$mode eq 'voice'">
<send target="ASRRecognizer" event="Prefetch"
namelist="$child $properties/fetchtimeout
$properties/maxage $properties/maxstale"/>
<else/>
<send target="DTMFRecognizer" event="Prefetch"
namelist="$child $properties/fetchtimeout
$properties/maxage $properties/maxstale"/>
</if>
</if>
<send target="controller" event="initialized"/>
</transition>
</state> <!-- end Initializing -->
<state id="Ready">
<transition event="execute" target="Executing"/>
</state> <!-- end Ready -->
<state id="Executing">
<onentry>
<!-- ISSUE: Initialization function to be completed -->
<assign location="$properties/fetchtimeout" expr="InitDefault();"/>
<assign location="$properties/maxage" expr="InitDefault();"/>
<assign location="$properties/maxstale" expr="InitDefault();"/>
<!-- ISSUE: Add condition if $child is externalgrammar element -->
<if cond="???">
<send target="$child/controller" event="execute"
namelist="$child"/>
<else/>
<!-- ISSUE: Missing in sendcontroller RC (e.g. link, field, etc)
as the handler for recognition results -->
<if cond="$mode eq 'voice'">
<send target="ASRRecognizer" event="AddGrammar"
namelist="$child $fetchhint $properties/language
$properties/charset $properties/encoding"/>
<else/>
<send target="DTMFRecognizer" event="AddGrammar"
namelist="$child $fetchhint $properties/language
$properties/charset $properties/encoding"/>
</if>
<send target="controller" event="executed"/>
</if>
</onentry>
<transition event="Executing.done">
<!-- ISSUE: Missing in send controller RC (e.g. link, field, etc)
as the handler for recognition results -->
<if cond="$mode eq 'voice'">
<send target="ASRRecognizer" event="AddGrammar"
namelist="$child $fetchhint $properties/language
$properties/charset $properties/encoding"/>
<else/>
<send target="DTMFRecognizer" event="AddGrammar"
namelist="$child $fetchhint $properties/language
$properties/charset $properties/encoding"/>
</if>
<send target="controller" event="executed"/>
</transition>
</state> <!-- end Executing -->
</state>
<!-- end Created -->
</scxml>
</pre>
</div>
</div>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<ul>
<li>Is double initialization in Idle and again in Initializing
necessary?</li>
<li>Initialization function should be expanded and specialized for
different parameters</li>
<li>How to get charset, encoding and language?</li>
<li>xml:lang might become present in many elements including
grammar</li>
<li>Base URI might be known at the point of grammar processing</li>
<li>consistent syntax to refer to $child</li>
<li>How to test if $child is 'externalgrammar' element? How to
access DOM? How to access controllers for recognition results (i.e.
link, field, etc)?</li>
<li>possible optimization to avoid duplicated <if> code in
Executing</li>
</ul>
</td>
</tr>
</table>
</div>
<div class="div3">
<h4><a name="d3e1997" id="d3e1997" />6.1.3 Events</h4>
<p>The events in this table may be raised during initialization and
execution of the <grammar> element.</p>
<a name="grammar:events" id="grammar:events" />
<table>
<caption>Table 20: <grammar> Events</caption>
<tbody>
<tr>
<td>Event</td>
<td>Description</td>
<td>State</td>
</tr>
<tr>
<th>error.semantic</th>
<td>indicates an error with data model expressions: undefined
reference, invalid expression resolution, etc.</td>
<td>execution</td>
</tr>
</tbody>
</table>
<p>Note that additional errors may occur when the grammar is
fetched or added by the ASR or DTMF resource. Please check there
for details.</p>
</div>
<div class="div3">
<h4><a name="grammar:examples" id="grammar:examples" />6.1.4
Examples</h4>
<p>[TBD: put all examples here.]</p>
</div>
</div>
<div class="div2">
<h3><a name="Grammar:InlineSRGSGrammarModule"
id="Grammar:InlineSRGSGrammarModule" />6.2 Inline SRGS Grammar
Module</h3>
<p>This module describes the syntactic and semantic features of
inline SRGS grammars used in ASR and DTMF recognition.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Issue: Do we need to support inline ABNF SRGS?:</p>
</td>
</tr>
</table>
<p>The attributes and content model of Inline SRGS grammars are
specified in <a href="#InlineSRGSGrammarModule:Syntax"><b>6.2.1
Syntax</b></a>. Its semantics are specified in <a
href="#InlineSRGSGrammarModule:Semantics"><b>6.2.2
Semantics</b></a>.</p>
<div class="div3">
<h4><a name="InlineSRGSGrammarModule:Syntax"
id="InlineSRGSGrammarModule:Syntax" />6.2.1 Syntax</h4>
<p>[See XXX for schema definitions].</p>
<p>The syntax of the Inline SRGS Grammar Module is precisely all of
the XML markup for a legal stand-alone XML form grammar as
described in SRGS (<a href="#SRGS">[SRGS]</a>), minus the XML
Prolog. Note that both elements and attributes must be in the SRGS
namespace (http://www.w3.org/2001/06/grammar).</p>
</div>
<div class="div3">
<h4><a name="InlineSRGSGrammarModule:Semantics"
id="InlineSRGSGrammarModule:Semantics" />6.2.2 Semantics</h4>
<div class="div4">
<h5><a name="d3e2057" id="d3e2057" />6.2.2.1 Definition</h5>
<p>The Inline SRGS grammar RC is defined in terms of a data model
and state model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the grammar RC controlling this inline grammar
RC</li>
<li>grammar: the text of the entire grammar</li>
</ul>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Should the contents of the grammar parameter be parsed rather
than the raw document text? For example, should it be the DOM
representation of the grammar, or just the XML Info set, or
what?</p>
</td>
</tr>
</table>
<p>The grammar RC's state model consists of the following states:
Idle, Initializing, and Ready. Unlike most of the other modules,
this module is primarily a data model for storing a grammar. The
module itself has no execution semantics.</p>
<p>While in the Idle state, the RC may receive an 'initialize'
event, whose 'controller' event data is used to update the data
model. The RC then transitions into the Initializing state.</p>
<p>In the Initializing state, the syntactic contents of the grammar
are saved into the grammar parameter. The RC sends the controller
an 'initialized' event and transitions to the Ready state.</p>
<p> </p>
</div>
<div class="div4">
<h5><a name="d3e2083" id="d3e2083" />6.2.2.2 Defined Events</h5>
<p>The Inline SRGS Grammar RC is defined to receive the following
events:</p>
<table border="1">
<caption>Table 21: Events received by Inline SRGS Grammar
RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialize</td>
<td>any</td>
<td>controller(M)</td>
<td>causes the element and its children to be initialized</td>
</tr>
</tbody>
</table>
<p>and the events it sends:</p>
<table border="1">
<caption>Table 22: Events sent by Inline SRGS Grammar RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialized</td>
<td>controller</td>
<td />
<td>response to initialize event indicating that it has been
successfully initialized</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e2135" id="d3e2135" />6.2.2.3 External Events</h5>
<p>The Inline SRGS Grammar Module does not send or receive any
external events.</p>
</div>
<div class="div4">
<h5><a name="d3e2140" id="d3e2140" />6.2.2.4 State Chart
Representation</h5>
<p /></div>
<div class="div4">
<h5><a name="d3e2144" id="d3e2144" />6.2.2.5 SCXML
Representation</h5>
</div>
</div>
<div class="div3">
<h4><a name="InlineSRGSGrammarModule:Events"
id="InlineSRGSGrammarModule:Events" />6.2.3 Events</h4>
<p>No module-specific events are raised during initialization of an
Inline SRGS Grammar. Note that validity failure of the inline SRGS
content would be detected at document parse time.</p>
<p> </p>
</div>
<div class="div3">
<h4><a name="InlineSRGSGrammarModule:examples"
id="InlineSRGSGrammarModule:examples" />6.2.4 Examples</h4>
<p>[TBD: put all examples here.]</p>
</div>
</div>
<div class="div2">
<h3><a name="Grammar:ExternalGrammarModule"
id="Grammar:ExternalGrammarModule" />6.3 External Grammar
Module</h3>
<p>This module describes the syntactic and semantic features of an
<externalgrammar> element which defines external grammars
used in ASR and DTMF recognition.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>The name of this element is still under discussion.</p>
</td>
</tr>
</table>
<p>The attributes and content model of <externalgrammar> are
specified in <a
href="#Grammar:ExternalGrammarModule:Syntax"><b>6.3.1
Syntax</b></a>. Its semantics are specified in <a
href="#Grammar:ExternalGrammarModule:Semantics"><b>6.3.2
Semantics</b></a>.</p>
<div class="div3">
<h4><a name="Grammar:ExternalGrammarModule:Syntax"
id="Grammar:ExternalGrammarModule:Syntax" />6.3.1 Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<div class="div4">
<h5><a name="d3e2188" id="d3e2188" />6.3.1.1 Attributes</h5>
<p>The <externalgrammar> element has the attributes specified
in Table 23.</p>
<a name="ExternalGrammarModule:attributes:external"
id="ExternalGrammarModule:attributes:external" />
<table>
<caption>Table 23: <externalgrammar> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>src</th>
<td><a
href="http://www.w3.org/TR/xmlschema-2/#anyURI">anyURI</a></td>
<td>The URI specifying the location of the grammar and optionally a
rulename within that grammar, if it is external. The URI is
interpreted as a rule reference as defined in Section 2.2 of the
Speech Recognition Grammar Specification <a href="#SRGS">[SRGS]</a>
but not all forms of rule reference are permitted from within
VoiceXML. The rule reference capabilities are described in detail
below this table.</td>
<td>No</td>
<td /></tr>
<tr>
<th>srcexpr</th>
<td>A data model expression</td>
<td>Equivalent to src, except that the URI is dynamically
determined by evaluating the content as a data model
expression.</td>
<td>No</td>
<td /></tr>
<tr>
<th>type</th>
<td>A data model expression</td>
<td>
<p>The preferred media type of the grammar. A resource indicated by
the URI reference in the src attribute may be available in one or
more media types. The author may specify the preferred media-type
via the type attribute. When the content represented by a URI is
available in many data formats, a VoiceXML platform may use the
preferred media-type to influence which of the multiple formats is
used. For instance, on a server implementing HTTP content
negotiation, the processor may use the preferred media-type to
order the preferences in the negotiation.</p>
<p>The resource representation delivered by dereferencing the URI
reference may be considered in terms of two types. The declared
media-type is the asserted value for the resource and the actual
media-type is the true format of its content. The actual media-type
should be the same as the declared media-type, but this is not
always the case (e.g. a misconfigured HTTP server might return
'text/plain for an 'application/srgs+xml' document). A specific URI
scheme may require that the resource owner always, sometimes, or
never return a media-type. The declared media-type is the value
returned by the resource owner or, if none is returned, the
preferred media type. There may be no declared media-type if the
resource owner does not return a value and no preferred type is
specified. Whenever specified, the declared media-type is
authoritative.</p>
<p>Three special cases may arise. The declared media-type may not
be supported by the processor; in this case, an
error.unsupported.format is thrown by the platform. The declared
media-type may be supported but the actual media-type may not
match; an error.badfetch is thrown by the platform. Finally, there
may be no declared media-type; the behavior depends on the specific
URI scheme and the capabilities of the grammar processor. For
instance, HTTP 1.1 allows document introspection (see <a
href="#RFC2616">[RFC2616]</a>, section 7.2.1), the data scheme
falls back to a default media type, and local file access defines
no guidelines. The following table provides some informative
examples:</p>
<table border="1">
<tbody>
<tr>
<td />
<td>HTTP 1.1 request</td>
<td>Local file access</td>
</tr>
<tr>
<td>Media-type returned by the resource owner</td>
<td>text/plain</td>
<td>application/srgs+xml</td>
<td><none></td>
<td><none></td>
</tr>
<tr>
<td>Preferred media-type appearing in the grammar</td>
<td>Not applicable; the returned type takes precedence</td>
<td>application/srgs+xml</td>
<td><none></td>
</tr>
<tr>
<td>Declared media-type</td>
<td>text/plain</td>
<td>application/srgs+xml</td>
<td>application/srgs+xml</td>
<td><none></td>
</tr>
<tr>
<td>Behavior if the actual media-type is application/srgs+xml</td>
<td>error.badfetch thrown; the declared and actual types do not
match</td>
<td>The declared and actual types match; success if
application/srgs+xml is supported by the processor; otherwise an
error.unsupported.format is thrown</td>
<td>Scheme specific; the processor might introspect the document to
determine the type.</td>
</tr>
</tbody>
</table>
</td>
<td>No</td>
<td><em>None</em></td>
</tr>
</tbody>
</table>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Error messages for "type" attribute need to be updated.</p>
</td>
</tr>
</table>
<p>See <a href="#ExternalSRGSGrammar:occurrence"><b>6.3.1.2 Content
Model</b></a> for restrictions on occurrence of src and srcexpr
attributes.</p>
<p>The value of the src attribute is a URI specifying the location
of the grammar with an optional fragment for the rulename. Section
2.2 of the Speech Recognition Grammar Specification <a
href="#SRGS">[SRGS]</a> defines several forms of rule reference.
The following are the forms that are permitted on a grammar element
in VoiceXML:</p>
<ul>
<li>Reference to a named rule in an external grammar: src attribute
is an absolute or relative URI reference to a grammar which
includes a fragment with a rulename. This form of rule reference to
an external grammar follows the behavior defined in Section 2.2.2
of <a href="#SRGS">[SRGS]</a>. If the URI cannot be fetched or if
the rulename is not defined in the grammar or is not a public
(activatable) rule of that grammar then an error.badfetch is
thrown.</li>
<li>Reference to the root rule of an external grammar: src
attribute is an absolute or relative URI reference to a grammar but
does not include a fragment identifying a rulename. This form
implicitly references the root rule of the grammar as defined in
Section 2.2.2 of <a href="#SRGS">[SRGS]</a>. If the URI cannot be
fetched or if the grammar cannot be referenced by its root (see
Section 4.7 of <a href="#SRGS">[SRGS]</a>) then an error.badfetch
is thrown.</li>
</ul>
<p>The following are the forms of rule reference defined by <a
href="#SRGS">[SRGS]</a> that are not supported in VoiceXML 3.</p>
<ul>
<li>Local rule reference: a fragment-only URI is not permitted.
(See definition in Section 2.2.1 of <a href="#SRGS">[SRGS]</a>). A
fragment-only URI value for the src attribute causes an
error.semantic event.</li>
<li>Reference to special rules: there is no support for special
rule references (NULL, VOID, GARBAGE) on the <grammar>
element itself. In the XML form of the SRGS specification, the only
way to include NULL, VOID, and GARBAGE is via the use of the
"special" attribute on the <ruleref> element. Thus, it is not
possible to reference individual uses of NULL, VOID, and GARBAGE
rules in a separate SRGS document, since that would require a
fragment identifier to place on the end of the URI referencing the
document, which in turn would require an id within that document
for the given use of NULL, VOID, or GARBAGE. Note that the external
grammar referenced from the <grammar> element may itself be
an SRGS grammar that contains a <ruleref> element with a
special attribute to reference NULL, VOID, or GARBAGE.</li>
</ul>
</div>
<div class="div4">
<h5><a name="ExternalSRGSGrammar:occurrence"
id="ExternalSRGSGrammar:occurrence" />6.3.1.2 Content Model</h5>
<p>The <externalgrammar> element is empty.</p>
</div>
<p>The <externalgrammar> element has the following
co-occurrence constraints:</p>
<ul>
<li>Exactly one of the "src" or "srcexpr" attributes must be
specified; otherwise, an error.badfetch event is thrown.</li>
</ul>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Editor: please remove the "otherwise, an error.badfetch ..."
from the above and all other co-occurrence text and write general
text somewhere describing what happens when a co-occurrence
constraint is violated.</p>
</td>
</tr>
</table>
</div>
<div class="div3">
<h4><a name="Grammar:ExternalGrammarModule:Semantics"
id="Grammar:ExternalGrammarModule:Semantics" />6.3.2 Semantics</h4>
<div class="div4">
<h5><a name="d3e2368" id="d3e2368" />6.3.2.1 Definition</h5>
<p>The External Grammar RC is defined in terms of a data model and
state model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>properties: src, type attribute values</li>
<li>controller: the controller RC of this
<externalgrammar></li>
<li>srcexpr: srcexpr attribute value</li>
</ul>
<p>The External Grammar RC's state model consists of the following
states: Idle, Initializing, Ready, and Executing.</p>
<p>While in the Idle state, the RC may receive an 'initialize'
event, whose 'controller' event data is used to update the data
model. The RC then transitions into the Initializing state.</p>
<p>In the Initializing state, the RC sends the controller an
'initialized' event and transitions to the Ready state.</p>
<p>In the Ready state, when the External Grammar RC receives an
'execute' event it transitions to the Executing state.</p>
<p>In the Executing state, if the srcexpr variable is set it is
evaluated against the data model as a data model expression, and
the value is placed into the src variable; if srcexpr cannot be
evaluated, an error.semantic event is thrown. Otherwise, the RC
sends an 'executed' event to the controller RC and transitions into
the Ready state.</p>
<p> </p>
</div>
<div class="div4">
<h5><a name="d3e2394" id="d3e2394" />6.3.2.2 Defined Events</h5>
<p>The External Grammar RC is defined to receive the following
events:</p>
<table border="1">
<caption>Table 25: Events received by External Grammar RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialize</td>
<td>any</td>
<td>controller(M)</td>
<td>causes the element and its children to be initialized</td>
</tr>
<tr>
<td>execute</td>
<td>controller</td>
<td></td>
<td>Evaluates srcexpr and populates src variable</td>
</tr>
</tbody>
</table>
<p>and the events it sends:</p>
<table border="1">
<caption>Table 26: Events sent by External Grammar RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialized</td>
<td>controller</td>
<td />
<td>response to initialize event indicating that it has been
successfully initialized</td>
</tr>
<tr>
<td>executed</td>
<td>controller</td>
<td />
<td>response to execute event indicating that it has been
successfully executed</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e2463" id="d3e2463" />6.3.2.3 External Events</h5>
<p>The External Grammar Module does not send or receive any
external events.</p>
</div>
<div class="div4">
<h5><a name="d3e2468" id="d3e2468" />6.3.2.4 State Chart
Representation</h5>
<p /></div>
<div class="div4">
<h5><a name="d3e2472" id="d3e2472" />6.3.2.5 SCXML
Representation</h5>
</div>
</div>
<div class="div3">
<h4><a name="Grammar:ExternalGrammarModule:Events"
id="Grammar:ExternalGrammarModule:Events" />6.3.3 Events</h4>
<p>The events that may be raised during initialization and
execution of the <externalgrammar> element are those defined
in Table 27 below.</p>
<a name="ExternalGrammarModule:events"
id="ExternalGrammarModule:events" />
<table>
<caption>Table 27: <externalgrammar> Events</caption>
<tbody>
<tr>
<td>Event</td>
<td>Description</td>
<td>State</td>
</tr>
<tr>
<th>error.semantic</th>
<td>indicates that there was an error in the evaluation of the
srcexpr attribute.</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="external_grammar:examples"
id="external_grammar:examples" />6.3.4 Examples</h4>
<p>[TBD: put all examples here.]</p>
</div>
</div>
<div class="div2">
<h3><a name="PromptModule" id="PromptModule" />6.4 Prompt
Module</h3>
<p>This module defines the syntactic and semantic features of a
<prompt> element which controls media output. The content
model of this element is empty: content is defined in other modules
which extend this element's content model (for example <a
href="#BuiltinSSMLModule"><b>6.5 Builtin SSML Module</b></a>, <a
href="#MediaModule"><b>6.6 Media Module</b></a> and <a
href="#ParseqModule"><b>6.7 Parseq Module</b></a>).</p>
<p>The attributes and content model of <prompt> are specified
in <a href="#PromptModule:Syntax"><b>6.4.1 Syntax</b></a>. Its
semantics are specified in <a
href="#PromptModule:Semantics"><b>6.4.2 Semantics</b></a>,
including how the final prompt content is determined and how the
prompt is queued for playback using the PromptQueue Resource (<a
href="#Resources:PromptQueue"><b>5.2 Prompt Queue
Resource</b></a>).</p>
<div class="div3">
<h4><a name="PromptModule:Syntax" id="PromptModule:Syntax" />6.4.1
Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<div class="div4">
<h5><a name="d3e2534" id="d3e2534" />6.4.1.1 Attributes</h5>
<p>The <prompt> element has the attributes specified in Table
28.</p>
<a name="prompt:attributes" id="prompt:attributes" />
<table>
<caption>Table 28: <prompt> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>bargein</th>
<td>boolean</td>
<td>Controls whether the prompt can be interrupted.</td>
<td>No</td>
<td><a title="" href="#Property:bargein">bargein</a> property</td>
</tr>
<tr>
<th>bargeintype</th>
<td>string</td>
<td>On prompts that can be interrupted, determines the type of
bargein, either 'speech', or 'hotword'.</td>
<td>No</td>
<td><a title="" href="#Property:bargeintype">bargeintype</a>
property</td>
</tr>
<tr>
<th>cond</th>
<td>data model expression</td>
<td>A data model expression that must evaluate to true after
conversion to boolean in order for the prompt to be played.</td>
<td>No</td>
<td>true</td>
</tr>
<tr>
<th>count</th>
<td>positive integer</td>
<td>A number indicating the repetition count, allowing a prompt to
be activated or not depending on the current repetition count.</td>
<td>No</td>
<td>1</td>
</tr>
<tr>
<th>timeout</th>
<td><a title="" href="#TimeDesignation">Time Designation</a></td>
<td>The time to wait for user input.</td>
<td>No</td>
<td><a title="" href="#Property:timeout">timeout</a> property</td>
</tr>
<tr>
<th>xml:lang</th>
<td>string</td>
<td>The <a href="#term-language">language identifier</a> for the
prompt.</td>
<td>No</td>
<td>document's "xml:lang" attribute</td>
</tr>
<tr>
<th>xml:base</th>
<td>string</td>
<td>Declares the base URI from which relative URIs in the prompt
are resolved.</td>
<td>No</td>
<td>document's "xml:base" attribute</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e2643" id="d3e2643" />6.4.1.2 Content Model</h5>
<p>The content model of the <prompt> element is empty.</p>
<p>Other modules can extend the content model. These modules must
define how the content is evaluated and processed before being
added to the prompt queue.</p>
</div>
</div>
<div class="div3">
<h4><a name="PromptModule:Semantics"
id="PromptModule:Semantics" />6.4.2 Semantics</h4>
<p>The prompt RC is the primary RC for the <prompt>
element.</p>
<div class="div4">
<h5><a name="d3e2655" id="d3e2655" />6.4.2.1 Definition</h5>
<p>The prompt RC is defined in terms of a data model and state
model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this prompt RC</li>
<li>children: array of children's (primary) RC</li>
<li>count: count attribute value</li>
<li>cond: cond attribute expression</li>
<li>properties: bargein, bargeintype and timeout attribute
values</li>
<li>xml:lang: xml:lang attribute value</li>
<li>xml:base: xml:base attribute value</li>
</ul>
<p>The prompt RC's state model consists of the following states:
Idle, Initializing, Ready, FormReady, and Executing. The initial
state is the Idle state.</p>
<p>While in the Idle state, the prompt RC may receive an
'initialize' event, whose controller event data is used to update
the data model. The prompt RC then transitions into Initializing
state.</p>
<p>In the Initializing state, the prompt RC initializes its
children: this is modeled as a separate RC (see XXX). The children
may return an error for initialization. If a child sends an error,
then the prompt RC returns an error. When all children are
initialized, the prompt RC sends the controller an 'initialized'
event and transitions to the Ready state.</p>
<p>In the Ready state, the prompt RC can receive a 'checkStatus'
event to check whether this prompt is eligible for execution or
not. The value of the cond parameter in its data model is checked
against the data model resource: the status is true if the value of
the cond parameter evaluates to true. The status, together with its
count data, is sent in a 'checkedStatus' event to the controller
RC. The controller RC then determines if the prompt is selected for
execution ([vxml20: 4.1.6], see PromptSelectionRC, Section XXX).
The prompt RC will then transition to the FormReady state. If the
prompt RC receives an 'execute' event and the cond parameter
evaluates to true, it transitions to the Executing state; if the
cond parameter evaluates to false, it will send the controller the
executed event and stay in the Ready state.</p>
<p>In the FormReady State, if the prompt RC receives a
'checkStatus' event, it will again check the cond parameter and
send the 'checkedStatus' event to the controller RC as in the Ready
State. In this state, if the RC receives an 'execute' event it
transitions to the Executing state.</p>
<p>In the Executing state, the prompt RC sends an evaluate event to
its children. Each child returns either an error, or content (which
may include parameters) for playback. If a child sends an error,
then the prompt RC returns an error. Once evaluation is complete,
the RC sends a queuePrompt event to the Prompt Queue Resource with
the <prompt> parameters (bargein, bargeintype, timeout) with
event data consisting of the list of content returned by its
children. The prompt RC then sends the controller an executed event
and transitions to the Ready state.</p>
</div>
<div class="div4">
<h5><a name="d3e2690" id="d3e2690" />6.4.2.2 Defined Events</h5>
<p>The Prompt RC is defined to receive the following events:</p>
<table>
<caption>Table 29: Events received by Prompt RC</caption>
<thead>
<tr>
<th>Event</th>
<th>Source</th>
<th>Payload</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>initialize</td>
<td>any</td>
<td>controller(M)</td>
<td>causes the element and its children to be initialized</td>
</tr>
<tr>
<td>checkStatus</td>
<td>controller</td>
<td />
<td>causes evaluation of the cond parameter against the data
model</td>
</tr>
<tr>
<td>execute</td>
<td>controller</td>
<td />
<td>causes the evaluation of its content and conversion to a format
suitable for queueing on the PromptQueue Resource</td>
</tr>
</tbody>
</table>
<p>and the events it sends:</p>
<table>
<caption>Table 30: Events sent by Prompt RC</caption>
<thead>
<tr>
<th>Event</th>
<th>Target</th>
<th>Payload</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>initialized</td>
<td>controller</td>
<td>response to initialize event indicating that it has been
successfully initialized</td>
<td /></tr>
<tr>
<td>checkedStatus</td>
<td>controller</td>
<td>status (M), count (M)</td>
<td>response to checkStatus event with count parameter and status
indicating evaluation of cond parameter</td>
</tr>
<tr>
<td>executed</td>
<td>controller</td>
<td />
<td>response to execute event indicating that it has been
successfully executed</td>
</tr>
</tbody>
</table>
<p></p>
</div>
<div class="div4">
<h5><a name="d3e2775" id="d3e2775" />6.4.2.3 External Events</h5>
<p>Table 31 shows the events sent and received by the prompts RC to
resources and other RCs which define the events.</p>
<a name="prompt:external-events" id="prompt:external-events" />
<table>
<caption>Table 31: Prompt RC External Events</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Target</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>evaluate</td>
<td>PromptRC</td>
<td>DataModel</td>
<td>used to evaluate the cond parameter (see Table 28)</td>
</tr>
<tr>
<td>queuePrompt</td>
<td>PromptRC</td>
<td>PromptQueue</td>
<td>adds prompt content and properties to the Prompt Queue (see <a
href="#Resources:PromptQueue"><b>5.2 Prompt Queue
Resource</b></a>)</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e2817" id="d3e2817" />6.4.2.4 State Chart
Representation</h5>
<img class="center" src="Images/PromptRC.png"
alt="Prompt RC in UML State Chart" />
<p class="caption">Figure 10: Prompt RC States</p>
</div>
<div class="div4">
<h5><a name="d3e2823" id="d3e2823" />6.4.2.5 SCXML
Representation</h5>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml initialstate="Created">
<datamodel>
<data id="properties"/>
<data id="children"/>
<data id="content"/>
<data id="properties"/>
<data id="count"/>
<data id="cond"/>
<data id="xml:lang"/>
<data id="xml:base"/>
</datamodel>
<state id="Created">
<initial id="Idle"/>
<state id="Idle">
<onentry>
<assign location="$controller" expr="null"/>
<assign location="$children" expr="null"/>
<assign location="$content" expr="null"/>
<assign location="$properties/bargein" expr="true"/>
<assign location="$properties/bargeintype" expr="speech"/>
<assign location="$properties/timeout" expr="5s"/>
<assign location="$count" expr="1"/>
<assign location="$cond" expr="true"/>
<assign location="$xml:lang" expr=""/>
<assign location="$xml:base" expr=""/>
</onentry>
<transition event="initialize" target="Initializing">
<assign name="$controller" expr="_eventData/controller"/>
<assign name="$children" expr="_eventData/children"/>
</transition>
</state> <!-- end Idle -->
<state id="Initializing">
<datamodel>
<data id="childcounter"/>
</datamodel>
<onentry>
<assign location="$childcounter" expr="0"/>
<foreach var="child" array="$children">
<send target="$child/controller" event="initialize"
namelist="$child/child"/>
</foreach>
</onentry>
<transition event="Initializing.done">
<assign location="$childcounter" expr="$childcounter + 1"/>
</transition>
<transition event="Initializing.error" target="Idle">
<assign location="$childcounter" expr="$childcounter + 1"/>
<send target="controller" event="initialize.error"
namelist="_eventData/error_status"/>
</transition>
<transition event="Initializing.done" cond="$childcounter eq
$children.size()-1" target="Ready">
<send target="controller" event="initialized"/>
</transition>
</state> <!-- end Initializing -->
<state id="Ready">
<datamodel>
<data id="status"/>
</datamodel>
<transition event="checkStatus" target="FormReady">
<assign location="$status" expr="checkStatus()"/>
<send target="controller" event="checkStatus"
namelist="$status, $count"/>
</transition>
<transition event="execute" cond="checkStatus() eq 'true'"
target="Executing"/>
<transition event="execute" cond="checkStatus() eq 'false'">
<send target="controller" event="executed"/>
</transition>
</state> <!-- end Ready -->
<state id="FormReady">
<datamodel>
<data id="status"/>
</datamodel>
<transition event="checkStatus">
<assign location="$status" expr="checkStatus()"/>
<send target="controller" event="checkStatus"
namelist="$status, $count"/>
</transition>
<transition event="execute" target="Executing"/>
</state> <!-- end FormReady -->
<state id="Executing">
<datamodel>
<data id = "prompt"/>
</datamodel>
<onentry>
<assign location="$counter" expr="0"/>
<assign location="$child_return" expr="null"/>
<foreach var="child" array="$children">
<send target="$child/controller" event="evaluateChild"/>
</foreach>
</onentry>
<transition event="Executing.done">
<assign location="$counter" expr="$counter + 1"/>
<insert pos="after" name="$prompt" expr="_eventData/prompts"/>
</transition>
<transition event="Executing.error" target="Idle">
<send target="controller" event="Executing.error"
namelist="_eventData/error_status"/>
</transition>
<transition event="Executing.done" cond="$counter eq
$children.size()-1" target="Ready">
<insert pos="after" name="$prompt" expr="_eventData/prompts"/>
<send target="PromptQueue" event="/queuePrompt"
namelist="$prompt, $properties"/>
<send target="controller" event="executed"/>
</transition>
</state> <!-- end Executing -->
</state>
<!-- end Created -->
</scxml>
</pre>
</div>
</div>
</div>
<div class="div3">
<h4><a name="PromptModule:Events" id="PromptModule:Events" />6.4.3
Events</h4>
<p>The events in Table 32 may be raised during initialization and
execution of the <prompt> element.</p>
<a name="prompt:events" id="prompt:events" />
<table>
<caption>Table 32: <prompt> Events</caption>
<tbody>
<tr>
<td>Event</td>
<td>Description</td>
<td>State</td>
</tr>
<tr>
<th>error.unsupported.language</th>
<td>indicates that an unsupported language was encountered. The
unsupported language is indicated in the event message
variable.</td>
<td>execution</td>
</tr>
<tr>
<th>error.unsupported.<em>element</em></th>
<td>indicates that the <em>element</em> within the <prompt>
element is not supported</td>
<td>initialization</td>
</tr>
<tr>
<th>error.badfetch</th>
<td>indicates that the prompt content is malformed ...</td>
<td>initialization, execution</td>
</tr>
<tr>
<th>error.noresource</th>
<td>indicates that a Prompt Queue resource is not available for
rendering the prompt content.</td>
<td>execution</td>
</tr>
<tr>
<th>error.semantic</th>
<td>indicates an error with data model expressions: undefined
datamodel reference, invalid expression resolution, etc.</td>
<td>execution</td>
</tr>
</tbody>
</table>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Can we really determine whether errors are raised in
initialization (syntax) or execution (evaluation) states? How does
this fit in with errors returned when prompts are played in
PromptQueue player implementation? ACTION: Clarify which specific
cases are affected by 'error.badfetch' ambiguity re. initialization
versus execution states.</p>
</td>
</tr>
</table>
</div>
<div class="div3">
<h4><a name="prompt:examples" id="prompt:examples" />6.4.4
Examples</h4>
<p>[TBD: put all examples here.]</p>
</div>
</div>
<div class="div2">
<h3><a name="BuiltinSSMLModule" id="BuiltinSSMLModule" />6.5
Builtin SSML Module</h3>
<p>This module describes the syntactic and semantic features of
SSML elements built into VoiceXML.</p>
<p>This module is designed to extend the content model of the
<prompt> element defined in <a href="#PromptModule"><b>6.4
Prompt Module</b></a>.</p>
<p>The attributes and content model of SSML elements are specified
in <a href="#SSMLModule:Syntax"><b>6.5.1 Syntax</b></a>. Its
semantics are specified in <a href="#SSMLModule:Semantics"><b>6.5.2
Semantics</b></a>, including how elements are evaluated to yield
final content for playback.</p>
<div class="div3">
<h4><a name="SSMLModule:Syntax" id="SSMLModule:Syntax" />6.5.1
Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<p>This module defines an SSML (<a href="#SSML">[SSML]</a>) <a
href="http://www.w3.org/TR/speech-synthesis/#S2.2.1">Conforming
Speech Synthesis Markup Language Fragment</a> where:</p>
<ul>
<li>there is no explicit <speak> element.</li>
<li>these elements are part of the VoiceXML namespace rather than
the SSML namespace</li>
<li>the <foreach> element may appear inside these elements
prior to evaluation</li>
<li>the <value> element may appear inside these elements
prior to evaluation</li>
<li>The <audio> element is extended with the attributes
specified in Table 33, in addition to the fetchtimeout, fetchhint,
maxage, and maxstale attributes as specified in <a
href="#Fetching"><b>8.1.1 Fetching</b></a>.</li>
</ul>
<p></p>
<a name="audio:vxmlattributes" id="audio:vxmlattributes" />
<table>
<caption>Table 33: <audio> Attributes defined in
VoiceXML</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>expr</th>
<td />
<td>A data model expression which determines the source of the
audio to be played. The expression may be either a reference to
audio previously recorded (see Record Module) or evaluate to the
URI of an audio resource to fetch.</td>
<td>No</td>
<td>undefined</td>
</tr>
</tbody>
</table>
<p>Exactly one of "src" or "expr" attributes must be specified;
otherwise, an error.badfetch event is thrown.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>SSML 1.1 required for fetching attributes like fetchtimeout? Or
profile dependent?</p>
</td>
</tr>
</table>
</div>
<div class="div3">
<h4><a name="SSMLModule:Semantics"
id="SSMLModule:Semantics" />6.5.2 Semantics</h4>
<p>When the RC receives an evaluate event, its children are
evaluated in order to return a document which can be processed by a
<a href="http://www.w3.org/TR/speech-synthesis/#S2.2.4">Conforming
Speech Synthesis Markup Language Processor</a>.</p>
<p>Evaluation consits of the following:</p>
<ul>
<li>data model expressions are evaluated against the data
model.</li>
<li>If a <foreach> element is present, it is evaluated so as
to yield content for each defined item in the array.</li>
<li>If an <audio> element has a specified expr attribute,
then the attribute value is evaluated to provide a URI value for
the src attribute. If the expr evaluation results in anything other
than a valid URI string, then the expr attribute and its content
are removed. ignored.</li>
<li>If a <value> element is present, its expr attribute is
evaluated to return a CDATA value.</li>
<li>construction of a <speak> element with appropriate
version, namespace, and xml:lang attributes. The xml:lang attribute
value is inherited from the <prompt> element (see <a
href="#PromptModule"><b>6.4 Prompt Module</b></a>).</li>
<li>if an unsupported language is encountered, the platform throws
an error.unsupported.language event which specifies the language in
its message variable</li>
</ul>
<p></p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Need to specify further error cases</p>
<p>Need to clarify unsupported languages and external (e.g. MRCP)
SSML processors.</p>
</td>
</tr>
</table>
</div>
<div class="div3">
<h4><a name="SSML_prompt:examples"
id="SSML_prompt:examples" />6.5.3 Examples</h4>
<p>In this example</p>
<div class="exampleInner">
<pre>
<prompt>
<foreach item="item" array="array">
<audio expr="item.audio"><value expr="item.tts"/></audio>
<break time="300ms"/>
</foreach>
</prompt>
</pre>
</div>
<p>evaluation returns a sequence of content for each item in
<foreach> with <audio> and <value> elements.</p>
<p>Assume that the array consists of 2 items where each item.audio
evaluates to 'one.wav' and 'two.wav' respectively, and each
item.tts evaluates to 'one' and 'two' respectively. Evaluation of
<foreach> is equivalent to the following</p>
<div class="exampleInner">
<pre>
<prompt>
<audio expr="'one.wav'"><value expr="'one'"/></audio>
<break time="300ms"/>
<audio expr="'two.wav'"><value expr="'two'"/></audio>
<break time="300ms"/>
</prompt>
</pre>
</div>
<p>further evaluation of the <audio> and <value>
elements result in</p>
<div class="exampleInner">
<pre>
<prompt>
<audio src="one.wav">one</audio>
<break time="300ms"/>
<audio src="two.wav">two</audio>
<break time="300ms"/>
</prompt>
</pre>
</div>
<p>and finally the prompt content is converted into a stand-alone
SSML document (assuming the <prompt>'s xml:lang attribute
evaluates to 'en'):</p>
<div class="exampleInner">
<pre>
<speak version="1.0" xml:lang="en"
xmlns="http://www.w3.org/2001/10/synthesis">
<audio src="one.wav">one</audio>
<break time="300ms"/>
<audio src="two.wav">two</audio>
<break time="300ms"/>
</speak>
</pre>
</div>
<p>This content is queued and played using the PromptQueue: each
audio URI, or fallback content, is played, followed by a 300
millisecond break.</p>
</div>
</div>
<div class="div2">
<h3><a name="MediaModule" id="MediaModule" />6.6 Media Module</h3>
<p>The media module defines the syntax and semantics of the
<media> element.</p>
<p>The module is designed to extend the content model of
<prompt> in the prompt module (<a href="#PromptModule"><b>6.4
Prompt Module</b></a>).</p>
<p>The <media> element can be seen as an enhanced and
generalized version of the VoiceXML <audio> element. It is
enhanced in that it provides additional attributes describing the
type of media, conditional selection, as well as control over
playback . It is a generalization of the <audio> element in
that it permits media other than audio to be played; for example,
media formats which contains audio and video tracks.</p>
<div class="div3">
<h4><a name="MediaModule:Syntax" id="MediaModule:Syntax" />6.6.1
Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<div class="div4">
<h5><a name="d3e3048" id="d3e3048" />6.6.1.1 Attributes</h5>
<p>The <media> element has the attributes specified in Table
34, in addition to the fetchtimeout, fetchhint, maxage, and
maxstale attributes as specified in <a href="#Fetching"><b>8.1.1
Fetching</b></a>.</p>
<a name="media:attributes" id="media:attributes" />
<table>
<caption>Table 34: <media> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>src</th>
<td />
<td>The URI specifying the location of the media source.</td>
<td>No</td>
<td>None</td>
</tr>
<tr>
<th>srcexpr</th>
<td />
<td>A data model expression which evaluates to a URI indicating the
location of the media resource.</td>
<td>No</td>
<td>undefined</td>
</tr>
<tr>
<th>cond</th>
<td />
<td>A data model expression that must evaluate to true after
conversion to boolean in order for the media to be played.</td>
<td>No</td>
<td>true</td>
</tr>
<tr>
<th>type</th>
<td />
<td>
<p>The preferred media type of the output resource. A resource
indicated by the URI reference in the <code>src</code> or
<code>expr</code> attributes may be available in one or more media
types. The author may specify the preferred media type via the
<code>type</code> attribute. When the content represented by a URI
is available in many data formats, a VoiceXML platform may use the
preferred media-type to influence which of the multiple formats is
used. For instance, on a server implementing HTTP content
negotiation, the processor may use the preferred media-type to
order the preferences in the negotiation.</p>
<p>The resource representation delivered by dereferencing the URI
reference may be considered in terms of two types. The <em>declared
media-type</em> is the asserted value for the resource and the
<em>actual media-type</em> is the true format of its content. The
actual media-type should be the same as the declared media-type,
but this is not always the case (e.g. a misconfigured HTTP server
might return 'text/plain' for a 'audio/x-wav' or video/3gpp'
resource). A specific URI scheme may require that the resource
owner always, sometimes, or never return a media-type. The declared
media-type is the value returned by the resource owner or, if none
is returned, the preferred media type. There may be no declared
media-type if the resource owner does not return a value and no
preferred type is specified. Whenever specified, the declared
media-type is authoritative.</p>
<p>Three special cases may arise.</p>
<ol class="enumar">
<li>The declared media-type may not be supported by the processor.
No error is thrown by the platform and the content of the
<code>media</code> element is played instead.</li>
<li>The declared media-type may be supported but the actual
media-type may not match. No error is thrown by the platform and
the content of the <code>media</code> element is played
instead.</li>
<li>Finally, there may be no declared media-type; the behavior
depends on the specific URI scheme and the media capabilities of
the VoiceXML processor. For instance, HTTP 1.1 allows document
introspection (see <a href="#RFC2616">[RFC2616]</a>, section
7.2.1), the data scheme falls back to a default media type, and
local file access defines no guidelines.</li>
</ol>
</td>
<td>No</td>
<td>undefined</td>
</tr>
<tr>
<th>clipBegin</th>
<td><a title="" href="#TimeDesignation">Time Designation</a></td>
<td>offset from start of media to begin rendering. This offset is
measured in normal media playback time from the beginning of the
media.</td>
<td>No</td>
<td>0s</td>
</tr>
<tr>
<th>clipEnd</th>
<td><a title="" href="#TimeDesignation">Time Designation</a></td>
<td>offset from start of media to end rendering. This offset is
measured in normal media playback time from the beginning of the
media.</td>
<td>No</td>
<td><em>None</em></td>
</tr>
<tr>
<th>repeatDur</th>
<td><a title="" href="#TimeDesignation">Time Designation</a></td>
<td>total duration for repeatedly rendering media. This duration is
measured in normal media playback time from the beginning of the
media.</td>
<td>No</td>
<td><em>None</em></td>
</tr>
<tr>
<th>repeatCount</th>
<td>positive <a title="" href="#">Real number</a> </td>
<td>number of iterations of media to render. A fractional value
describes a portion of the rendered media.</td>
<td>No</td>
<td>1</td>
</tr>
<tr>
<th>soundLevel</th>
<td>signed ("+" or "-") CSS2 numbers immediately followed by
"dB"</td>
<td>Decibel values are interpreted as a ratio of the squares of the
new signal amplitude (a1) and the current amplitude (a0) and are
defined in terms of dB: soundLevel(dB) = 20 log10 (a1 / a0) A
setting of a large negative value effectively plays the media
silently. A value of '-6.0dB' will play the media at approximately
half the amplitude of its current signal amplitude. Similarly, a
value of '+6.0dB' will play the media at approximately twice the
amplitude of its current signal amplitude (subject to hardware
limitations). The absolute sound level of media perceived is
further subject to system volume settings, which cannot be
controlled with this attribute.</td>
<td>No</td>
<td>+0.0dB</td>
</tr>
<tr>
<th>speed</th>
<td>x% (where x is a positive real value)</td>
<td>the speed at which to play the referenced media, relative to
the original speed. The speed is set to the requested percentage of
the speed of the original media. For audio, a change in the speed
will change the rate at which recorded samples are played back and
this will affect the pitch.</td>
<td>No</td>
<td>100%</td>
</tr>
<tr>
<th>outputmodes</th>
<td>space separated list of media types</td>
<td>Determines the modes used for media output. See <a
href="#Properties:Media"><b>8.2.4 Media Properties</b></a> for
further details.</td>
<td>No</td>
<td><a title="" href="#Property:outputmodes">outputmodes</a>
property</td>
</tr>
</tbody>
</table>
<p>See <a href="#mediaOccurenceConstraint">occurrence
constraints</a> for restrictions on occurrence of src and srcexpr
attributes.</p>
<p>Calculations of rendered durations and interaction with other
timing properties follow SMIL 2.1 <a
href="http://www.w3.org/TR/SMIL/smil-timing.html#Timing-ComputingActiveDur"
shape="rect">Computing the active duration</a> where</p>
<ul>
<li><media> is a time container</li>
<li><a title="" href="#TimeDesignation">Time Designation</a> values
for clipBegin, clipEnd, and repeatDur are a subset of SMIL
Clock-value</li>
<li>If the length of an media clip is not known in advance then it
is treated as indefinite. Consequently repeatCount will have no
effect.</li>
<li>If clipEnd is after the end of the media, then rendering ends
at the media end.</li>
<li>If clipBegin is after clipEnd, no audio will be produced.</li>
<li>If clipBegin equals clipEnd, the behavior depends upon the kind
of media. For media with a concept of frames, such as video, the
single frame at the beginning of clipBegin is rendered for
repeatDur.</li>
<li>repeatDur takes precedence over repeatCount in determining the
maximum duration of the media.</li>
</ul>
<p>Note that not all SMIL 2.1 Timing features are supported.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Use SMIL 3.0 or SMIL 2.1 reference?</p>
</td>
</tr>
</table>
</div>
<div class="div4">
<h5><a name="d3e3275" id="d3e3275" />6.6.1.2 Content Model</h5>
<p>The <media> element content model consists of:</p>
<ul>
<li>Inline content: SSML <speak> (0 or 1). Note that this
content may include <value> and <foreach> elements from
the VoiceXML namespace.</li>
<li><desc> element (0 or more)</li>
<li><media>: for fallback in the case where the resource
referenced by the mother <media> element is unavailable (0 or
more)</li>
</ul>
<p></p>
<div id="mediaOccurenceConstraint">
<p>The <media> has the following co-occurrence
constraints:</p>
<ul>
<li>One of the src attribute or the srcexpr attribute or inline
content must be specified; otherwise, an error.badfetch event is
thrown.</li>
</ul>
</div>
<p>Note that the type attribute does not affect inline content. The
handling of inline XML content is in accordance to the namespace of
the root element (such as SSML <speak>, SMIL <smil>,
and so forth). CDATA, or mixed content with VoiceXML
<foreach> or <value> elements <strong>must</strong> be
treated as an SSML Fragment and evaluated as described in <a
href="#MediaModule:Semantics"><b>6.6.2 Semantics</b></a>.</p>
<div class="div5">
<h6><a name="d3e3302" id="d3e3302" />6.6.1.2.1 Tips
(informative)</h6>
<p>Developers should be aware that there may be performance
implications when using <media> depending on which attributes
are specified, the media itself, its transport and processing.</p>
<p>Since operations like trimming, soundLevel and speed
modifications are applied to media, this requires that the SSML
processor begins generating output audio before these operations
are applied. If the clipBegin attribute is specified, this may
required SSML generation of audio prior to clipBegin, depending on
the implementation. This may lead to a gap between execution of the
<media> element and start of playback.</p>
<p>If the media is fetched with HTTP protocol and the clipBegin
attribute is specified, then, unless the the resource is cached
locally, the part of the media resource before the clipBegin, will
still be fetched from the origin server. This may result in a gap
between the execution of the <media> element and playback
actually beginning.</p>
<p>Note also if <media> uses the RTSP protocol, and the
VoiceXML platform supports this protocol, then the clipBegin
attribute value may be mapped to the RTSP <code>Range</code> header
field, thereby reducing the gap between element execution and the
onset of playback.</p>
</div>
</div>
</div>
<div class="div3">
<h4><a name="MediaModule:Semantics"
id="MediaModule:Semantics" />6.6.2 Semantics</h4>
<p>When an media RC receives an evaluate event, the following
operations are performed:</p>
<ul>
<li>attributes with data model expressions are evaluated against
the data model</li>
<li>if inline SSML content is specified (i.e. <speak> root),
then its RC is sent an evaluate event (where any <foreach>
and <value> elements are evaluated).</li>
<li>if inline CDATA content (i.e. CDATA root), or <foreach>
and <value> root elements which evaluate to CDATA content,
then it is treated as SSML <speak> content.</li>
<li>if the media resource has not yet been fetched, the resource is
fetched. If SSML content is specified, then the evaluated content
is processed by the SSML processor and a media resource
returned.</li>
</ul>
<p>The resulting media resource is returned together with resolved
media operation properties (clipBegin, clipEnd, soundLevel, speed,
outputmodes).</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Semantics needs to address a mixed content model; e.g. CDATA and
XML elements as children of the root.</p>
<p>Do we require 'application/ssml+xml' type with SSML and CDATA
content?</p>
<p>Need to clarify where resource fetching takes place in the
semantic model. Eg. in prompt initializing or executing state? or
in prompt queue?</p>
<p>This approach assumes the prompt queue applies media processing
operations. Intended to fit with the VCR/RTC approach.</p>
<p>What about streaming cases? Allow streams to be returned?</p>
<p>Specify how errors are addressed.</p>
</td>
</tr>
</table>
</div>
<div class="div3">
<h4><a name="MediaModule:Examples"
id="MediaModule:Examples" />6.6.3 Examples</h4>
<p>Playback of external audio media resource.</p>
<div class="exampleInner">
<pre>
<media type="audio/x-wav" src="http://www.example.com/resource.wav"/>
</pre>
</div>
<p>Application of media operations to audio resource. The
soundLevel increases the volume by approximately 50% and the speed
is reduced to 50%.</p>
<div class="exampleInner">
<pre>
<media type="audio/x-wav" soundLevel="+6.0dB" speed="50%"
src="http://www.example.com/resource.wav"/>
</pre>
</div>
<p>Playback of 3GPP media resource.</p>
<div class="exampleInner">
<pre>
<media type="video/3gpp" src="http://www.example.com/resource.3gp"/>
</pre>
</div>
<p>Playback of 3GPP media resource with the speed doubled and
playback ending after 5 seconds.</p>
<div class="exampleInner">
<pre>
<media type="video/3gpp" clipEnd="5s" speed="200%"
src="http://www.example.com/resource.3gp"/>
</pre>
</div>
<p>Playback of external SSML document.</p>
<div class="exampleInner">
<pre>
<media type="application/ssml+xml"
src="http://www.example.com/resource.ssml"/>
</pre>
</div>
<p>Inline CDATA content with a <value> element</p>
<div class="exampleInner">
<pre>
<media>
Ich bin ein Berliner, said <value expr="speaker"/>
</media>
</pre>
</div>
<p>which is syntactically equivalent to</p>
<div class="exampleInner">
<pre>
<media>
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis">
Ich bin ein Berliner, said <value expr="speaker"/>
</speak>
</media>
</pre>
</div>
<p>Inline SSML content to which gain and clipping operations are
applied.</p>
<div class="exampleInner">
<pre>
<media soundLevel="+4.0dB" clipBegin="4s">
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis">
Ich bin ein Berliner.
</speak>
</media>
</pre>
</div>
<p>Inline SSML with audio media fallback.</p>
<div class="exampleInner">
<pre>
<media volume="+4.0dB" clipBegin="4s">
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis">
Ich bin ein Berliner.
</speak>
<media type="audio/x-wav" src="ichbineinberliner.wav">
</media>
</pre>
</div>
</div>
</div>
<div class="div2">
<h3><a name="ParseqModule" id="ParseqModule" />6.7 Parseq
Module</h3>
<p>This module defines the syntax and semantics of <par> and
<seq> elements. The <par> element specifies playback of
media in parallel, while <seq> specifies playback in
sequence.</p>
<p>The module is designed to extend the content model of the
<prompt> element (<a href="#PromptModule"><b>6.4 Prompt
Module</b></a>).</p>
<p>This module is dependent upon the media module (<a
href="#MediaModule"><b>6.6 Media Module</b></a>).</p>
<p>With connections which support multiple media streams, it is
possible to simultaneously playback multiple media types. For media
container formats like 3GPP, audio and video media can be generated
simultaneously from the same media resource.</p>
<p>There are established use cases for simultaneous playback of
multiple media which are specified in separate resources:</p>
<ul>
<li>Video mail: an audio message has been left using a conventional
audio only system. For playback on a system with video support, a
video resource can be played simultaneously with an image of the
person, or an avatar.</li>
<li>Enterprise: a video stream resource from a security camera with
TTS voiceover providing additional information.</li>
<li>Education: a video resource showing medical procedure with
commentary provided by lecturer in student's language.</li>
<li>Talking heads: an animated avatar together with audio or TTS
voiceover.</li>
</ul>
<p>The intention is provide support for basic use cases where audio
or TTS output from one resource can be complemented with output
from another resource as permitted by the connection and platform
capabilities.</p>
<div class="div3">
<h4><a name="ParseqModule:Syntax" id="ParseqModule:Syntax" />6.7.1
Syntax</h4>
<p>The <par> element is derived from SMIL <par>
element, a time container for parallel output of media resources.
Media elements (or containers) within a <par> element are
played back in parallel.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">SMIL reference should be
added in <a href="#References"><b>B References</b></a>. SMIL is
Synchronized Multimedia Integration Language (SMIL). Reference to
<a href="http://www.w3.org/TR/REC-smil/">SMIL 1.0</a> (or later)
Specification.</td>
</tr>
</table>
<p>The <par> element has the attributes specified in Table
35.</p>
<a name="parseq:parattributes" id="parseq:parattributes" />
<table>
<caption>Table 35: <par> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>endsync</th>
<td />
<td>Indicates when element is considered complete. 'first'
indicates that the element is complete when any media (or
container) child reports that it is complete; 'last' indicates it
is complete when all media children are complete.</td>
<td>No</td>
<td>last</td>
</tr>
</tbody>
</table>
<p>The content model of <par> consists of:</p>
<ul>
<li><media> elements (0 or more)</li>
<li><seq> elements (0 or more)</li>
</ul>
<p></p>
<p>The <par> element is derived from SMIL <seq>
element, a time container for sequential output of media resources.
Media elements within a <seq> element are played back in
parallel.</p>
<p>No attributes are defined for <seq>.</p>
<p>The content model of <seq> consists of:</p>
<ul>
<li><media> elements (0 or more)</li>
</ul>
<p></p>
</div>
<div class="div3">
<h4><a name="ParseqModule:Semantics"
id="ParseqModule:Semantics" />6.7.2 Semantics</h4>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Issue: how should parallel playback interact with the
PromptQueue resource? The simplest assumption would be that if this
module is supported, then prompt queue needs to be able to handle
parallel playback.</p>
<p>For example when bargein event happens during the parallel
execution, the synchronization between both prompt and for example
video play should be handled. This information should be explained
in the prompt queue resource section.</p>
</td>
</tr>
</table>
<p>This module requires a PromptQueue resource which support
playback of parallel and sequential media. The following defines
its playback completion, termination and error handling.</p>
<p>Completion of playback of the <par> element is determined
according to the value of its endsync attribute. For instance,
assume a <par> element containing <media> (or
<seq>) elements A and B, and that B finishes before A. If
endsync has the value first, then completion is reported upon B's
completion. If endsync has the value last, then completion is
reported upon A's completion.</p>
<p>Completion of playback of the <seq> element occurs when
the last <media> is complete.</p>
<p>If the <par> element playback is terminated, then playback
of its <media> and <seq> children is terminated.
Likewise, if the <seq> element playback is terminated, then
playback of its (active) <media> elements is terminated.</p>
<p>If mark information is provided by <media> elements (for
example with SSML), then, the mark information associated with last
element played in sequence or parallel is exposed as described in
XXX.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Open issue: Clarify interaction with VCR media control
model(s).</p>
<p><reposition> approach would require that <par> and
<seq> need to be able to restart from a specific position
indicated by the markname/time of a <media> element contained
within them.</p>
<p>RTC approach would require that for <par>, media
operations are applied in parallel.</p>
</td>
</tr>
</table>
<p>Error handling policy is inherited from the element in which
<par> and <seq> element are children.</p>
<p>For instance if the policy is to ignore errors, then the
following applies:</p>
<ul>
<li>If an error occurs when playing a <media> element in
<par>, then the error is ignored.</li>
<li>Likewise, if there is an error playing back a <media>
element in <seq>, the error is ignored and the next
<media> element in the sequence, if there is one, is
played.</li>
<li>If the <media> element in which the error occurs is the
final one in the <par> element, then completion of
<par> playback is signaled when the error is detected.</li>
</ul>
<p></p>
<p>If the policy is to terminate playback and report the error,
then the any error causes immediate termination of any playback and
the error is reported.</p>
<p>If execution of the <par> and <seq> elements
requires media capabilities which are not supported by the platform
or the connection, or there is an error fetching or playing any
<media> element within <par> or <seq>, then error
handling follows the defined policy.</p>
</div>
<div class="div3">
<h4><a name="ParseqModule:Examples"
id="ParseqModule:Examples" />6.7.3 Examples</h4>
<p>video avatar with audio commentary. Note the use of the
outputmodes attributes of <media> to ensure that only video
is played.</p>
<div class="exampleInner">
<pre>
<par>
<media type="audio/x-wav" src="commentary.wav"/>
<media type="video/3gpp" src="avatar.3gp" outputmodes="video"/>
</par>
</pre>
</div>
<p>video avatar with a sequence of audio and TTS commentary.</p>
<div class="exampleInner">
<pre>
<par>
<seq>
<media type="audio/x-wav" src="intro.wav"/>
<media type="application/ssml+xml" src="commentary.ssml"/>
</seq>
<media type="video/3gpp" src="avatar.3gp" outputmodes="video"/>
</par>
</pre>
</div>
</div>
</div>
<div class="div2">
<h3><a name="ForeachModule" id="ForeachModule" />6.8 Foreach
Module</h3>
<p>This module describes the syntactic and semantic features of the
<foreach> element.</p>
<p>This module is designed to extend the content model of an
element in another module. For example, SSML elements in the <a
href="#BuiltinSSMLModule"><b>6.5 Builtin SSML Module</b></a>, the
<prompt> element defined in <a href="#PromptModule"><b>6.4
Prompt Module</b></a>, etc.</p>
<p>The attributes and content model of the element are specified in
<a href="#ForeachModule:Syntax"><b>6.8.1 Syntax</b></a>. Its
semantics are specified in <a
href="#ForeachModule:Semantics"><b>6.8.2 Semantics</b></a>.</p>
<div class="div3">
<h4><a name="ForeachModule:Syntax"
id="ForeachModule:Syntax" />6.8.1 Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<div class="div4">
<h5><a name="d3e3564" id="d3e3564" />6.8.1.1 Attributes</h5>
<p>The <foreach> element has the attributes specified in
Table 36.</p>
<a name="foreach:attributes" id="foreach:attributes" />
<table>
<caption>Table 36: <foreach> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>array</th>
<td />
<td>A data model expression that must evaluate to an array;
otherwise, an error.semantic event is thrown. Note that the
<foreach> element operates on a shallow copy of the array
specified by the array attribute.</td>
<td>Yes</td>
<td /></tr>
<tr>
<th>item</th>
<td />
<td>A data model variable that stores each array item upon each
iteration of the loop. A new variable will be declared if it is not
already defined within the parent's scope.</td>
<td>Yes</td>
<td /></tr>
</tbody>
</table>
<p>Both "array" and "item" must be specified; otherwise, an
error.badfetch event is thrown.</p>
<p>The iteration process starts from an index of 0 and increments
by one to an index of array_name.length - 1, where array_name is
the name of the shallow copied array operated on by the
<foreach> element. For each index, a shallow copy or
reference to the corresponding array element is assigned to the
item variable (i.e. <foreach> assignment is equivalent to
item = array_name[index] in ECMAScript); the assigned value could
be undefined for a sparse array. Undefined array items are
ignored.</p>
<p>VoiceXML 3.0 does not provide break functionality to interrupt a
<foreach>.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Clarify that array items which evaluate to ECMAScript undefined
are ignored?</p>
</td>
</tr>
</table>
</div>
<div class="div4">
<h5><a name="d3e3616" id="d3e3616" />6.8.1.2 Content Model</h5>
<p>The content model of the <foreach> element is dependent
upon the element in which it is a child. The profile in which this
element is used must specify the content model(s) of this
element.</p>
</div>
</div>
<div class="div3">
<h4><a name="ForeachModule:Semantics"
id="ForeachModule:Semantics" />6.8.2 Semantics</h4>
<p>When the RC receives an evaluate event, the RC loops through the
array to produce an evaluated content for each item in the
array.</p>
</div>
<div class="div3">
<h4><a name="ForeachModule:examples"
id="ForeachModule:examples" />6.8.3 Examples</h4>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>These examples may be moved to the respective profile section
later.</p>
</td>
</tr>
</table>
<p>The vxml21 profile defines the content model for the
<foreach> element so that it may appear in executable content
and within <prompt> elements.</p>
<p>Within executable content, except within a <prompt>, the
<foreach> element may contain any elements of executable
content; this introduces basic looping functionality by which
executable content may be repeated for each element of an
array.</p>
<p>When <foreach> appears within a <prompt> element as
part Builtin SSML content, it may contain only those elements valid
within <enumerate> (i.e. the same elements allowed within
<prompt> less <meta>, <metadata>, and
<lexicon>); this allows for sophisticated concatenation of
prompts.</p>
<p>In this example using Builtin SSML, each item in the array has
an audio property with a URI value, and a tts property with SSML
content. The element loops through the array, playing the audio URI
or the SSML content as fallback, with a 300 millisecond break
between each iteration.</p>
<div class="exampleInner">
<pre>
<prompt>
<foreach item="item" array="array">
<audio expr="item.audio"><value expr="item.tts"/></audio>
<break time="300ms"/>
</foreach>
</prompt>
</pre>
</div>
<p></p>
<p>In the mediaserver profile, <foreach> may occurs within
<prompt> elements and has the content model of 0 or more
<media> elements.</p>
<p>Play each media resource in the array.</p>
<div class="exampleInner">
<pre>
<foreach item="item" array="array">
<media type="audio/x-wav" src="item.audio"/>
</foreach>
</pre>
</div>
<p>Play each media resource in the array.</p>
<div class="exampleInner">
<pre>
<foreach item="item" array="array">
<media type="audio/x-wav" src="item.wav">
<media type="application/ssml+xml">
<speak version="1.0" xmlns="http://www.w3.org/2001/10/synthesis">
<value expr="item.tts"/>
<break time=300ms"/>
</speak>
</media>
</media>
</foreach>
</pre>
</div>
</div>
</div>
<div class="div2">
<h3><a name="FormModule" id="FormModule" />6.9 Form Module</h3>
<div class="div3">
<h4><a name="d3e3661" id="d3e3661" />6.9.1 Syntax</h4>
<p>Forms are the key component of VoiceXML documents. A form
contains:</p>
<ul>
<li>A set of form items, elements that are visited in the main loop
of the form interpretation algorithm. Form items are subdivided
into input items that can be 'filled' by user input and control
items that cannot.</li>
<li>Declarations of non-form item variables.</li>
<li>Event handlers.</li>
<li>"Filled" actions, blocks of procedural logic that execute when
certain combinations of input item variables are assigned.</li>
</ul>
<p></p>
<a name="form:attributes" id="form:attributes" />
<table>
<caption>Table 37: Table: <form> Attributes</caption>
<tbody>
<tr>
<th>id</th>
<td>The name of the form. If specified, the form can be referenced
within the document or from another document. For instance <form
id="weather">, <goto next="#weather">.</td>
</tr>
<tr>
<th>scope</th>
<td>The default scope of the form's grammars. If it is dialog then
the form grammars are active only in the form. If the scope is
document, then the form grammars are active during any dialog in
the same document. If the scope is document and the document is an
application root document, then the form grammars are active during
any dialog in any document of this application. Note that the scope
of individual form grammars takes precedence over the default
scope; for example, in non-root documents a form with the default
scope "dialog", and a form grammar with the scope "document", then
that grammar is active</td>
</tr>
</tbody>
</table>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>This section needs to be updated to reflect the new V3 Form
behavior, perhaps removing all references to the FIA. Essentially
the whole module needs to be reworked.</p>
</td>
</tr>
</table>
</div>
<div class="div3">
<h4><a name="d3e3696" id="d3e3696" />6.9.2 Semantics</h4>
<div class="div4">
<h5><a name="RC:Form" id="RC:Form" />6.9.2.1 Form RC</h5>
<p>The Form RC is the primary RC for the <form> element.</p>
<p>The Form RC interacts with resource controllers of other modules
so as to provide the behavior of VoiceXML 2.1/2.0 <form> tag.
Input and control form items are modeled as resource controllers:
for the example, the <field> RC (<a
href="#RC:Field"><b>6.10.2.1 Field RC</b></a>) of the Field
Module.</p>
<p>The behavior of the Form RC follows the VoiceXML FIA, although
some aspects of this are not modeled directly in this RC: external
transition handling is not part of the form RC; input items used
separate RCs to manage coordination between media resources, while
recognition results can be received directly by form, field or
other RCs.</p>
<p>[This initial version does not address all aspects of FIA
behavior; for example, event handling, error handling and external
transitions are not covered.]</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">This description of the
form needs to be updated with all the new functionality we have
given the form via our new eventing approach.</td>
</tr>
</table>
<div class="div5">
<h6><a name="d3e3715" id="d3e3715" />6.9.2.1.1 Definition</h6>
<p>The form RC is defined in terms of a data model and state
model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this form RC</li>
<li>children: array of children's (primary) RC</li>
<li>activeItem: current form item being executed</li>
<li>active: Boolean indicating whether this form is active.
Default: false.</li>
<li>justFilled: array of child RC which have just been filled</li>
<li>recoResult: The recognition result of the previously executed
form item.</li>
<li>previousItem: The previous form item already executed.</li>
<li>nextItem: The next form item which is presently scheduled for
executed.</li>
<li>modal: The modality of the current form item being
executed.</li>
<li>id: The form identifier.</li>
</ul>
<p></p>
<p>The form RC's state model consists of the following states:
Idle, Initializing, Ready, SelectingItem, PreparingItem,
PreparingFormGrammars, PreparingOtherGrammars, Executing, Active,
ProcessingFormResult, Evaluating and Exit.</p>
<p>In the Idle state, the form RC can receive an 'initialize' event
whose 'controller' event data is used to update the data model. The
RC then transitions into Initiating state.</p>
<p>In the Initializing state, the RC creates a dialog scope in the
Datamodel Resource and then initializes its children: this is
modeled as a separate RC. When all children are initialized, the RC
sends an 'initialized' event to its controller and transitions to
the Ready state.</p>
<p>In the Ready state, the form RC sets its active status to false.
It can receive one of two events: 'prepareGrammars' or ‘execute’.
‘prepareGrammars’ indicates that another form is active, but this
form's form-level grammars may be activated; an 'execute' event
indicates that this form is active. If the RC receives a
'prepareGrammars' event, it transitions to the
PreparingFormGrammars state. If the RC receives an 'execute' event,
it sets its active data to true and transitions to the
'SelectingItem' state.</p>
<p>In the SelectingItem state, the RC determines which form item to
select as the active item. This is defined by a FormItemSelection
RC which iterates over the children sending each a 'checkStatus'
event. If a child returns a true status (indicating that it ready
for execution)), the activeItem is set to this child RC and the RC
transitions to the PreparingItem state. If no child returns this
status, then the RC is complete and transitions the Exit State.</p>
<p>In the PreparingItem state, the activeItem is sent a 'prepare'
event causing it to prepare itself; for example, the field RC
prepares its prompts and grammars for execution. When the
activeItem returns a 'prepared' event, the event data indicates
whether the item is modal or not. If the item is modal, then the
form RC transitions to the Executing state. If the item is not
modal (other grammars can be activated), then the form RC
transitions to the PreparingFormGrammars state.</p>
<p>In the PreparingFormGrammars state, the RC prepares form-level
grammars. This is defined by a separate RC which iterates through
and executes grammar children. When this is complete, the RC
transitions to the Active state if the form is not active (active
data), and transitions to the PreparingOtherGrammars if the form is
active.</p>
<p>In the PreparingOtherGrammars states, the RC sends a
'prepareGrammars' event to its controller RC (which in turn sends
the event to appropriate form, document and application level RCs
with grammars). When its receives a 'prepared' from its controller,
the RC transitions to the Executing state.</p>
<p>In the Executing state, the form RC sends an 'execute' event to
the active form item. If the form item is a field, then this will
causes prompts to be played and recognition to take place. The RC
then transitions to the Active state awaiting a result.</p>
<p>In the Active state, the RC re-initializes the justFilled data
to a new array and waits for a recognition results (as active or
non-active form), or for a signal from its selected form item that
it has received the recognition result. Recognition results are
divided into two types: form item level results, received and
processed by the form item; and form level results which are
received by the form RC which caused the grammar to be added. If a
'recoResult' event is received by the form RC, the RC transitions
into the ProcessingFormResult state. If the active form item
receives the recognition result (and locally updated itself), then
the form RC receives a 'formItemResult' event, adds the active item
to the justFilled array, and transitions into the Evaluating
state.</p>
<p>In the ProcessingFormResult state, the recognition result is
processed by iterating through the form item children, obtaining
their name and slotname, and then attempting to match the slotname
to the results. If the match is successful, the name variable in
the data model result is updated with the value from the
recognition result and the child is added to the justFilled data
array. When this process is complete, the form RC transitions to
the Evaluating state.</p>
<p>In the Evaluating state, the form RC then iterates through its
children and if a child is a member of the 'JustFilled' array, it
sends a 'evaluate' event to the form item RC causing the
appropriate filled RCs to be executed. If the child is a filled RC,
then it is executed if appropriate. When evaluation is complete,
the form RC transitions to the 'selectformitem' state so that the
next form item can be selected for execution.</p>
</div>
<div class="div5">
<h6><a name="d3e3768" id="d3e3768" />6.9.2.1.2 Defined Events</h6>
<p>The Form RC is defined to receive the following events:</p>
<a name="formRC:eventsRecieved" id="formRC:eventsRecieved" />
<table>
<caption>Table 38: Table: Events received by <form>
RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialize</td>
<td>any</td>
<td>controller(M)</td>
<td>Update the data model</td>
</tr>
<tr>
<td>prepareGrammars</td>
<td>controller</td>
<td />
<td>Another form is active, but the current form's form-level
grammars may be activated.</td>
</tr>
<tr>
<td>execute</td>
<td>controller</td>
<td />
<td>Current form is active</td>
</tr>
</tbody>
</table>
<p>and the events it sends:</p>
<a name="formRC:eventsSent" id="formRC:eventsSent" />
<table>
<caption>Table 39: Table: Events sent by <form> RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialize</td>
<td>controller</td>
<td />
<td>Notification that initialization is complete</td>
</tr>
<tr>
<td>prepareGrammars</td>
<td>controller</td>
<td />
<td>Sent to prepare grammars to appropriate form, document and
application level RCs.</td>
</tr>
<tr>
<td>execute</td>
<td>controller</td>
<td />
<td>Notification of complete recognition result from the field
RC.</td>
</tr>
</tbody>
</table>
</div>
<div class="div5">
<h6><a name="d3e3852" id="d3e3852" />6.9.2.1.3 External Events</h6>
<p>The following table shows the events sent and received by the
form RC to resources and other RCs which define the events.</p>
<a name="formRC:externalEvents" id="formRC:externalEvents" />
<table>
<caption>Table 40: Table: <form> RC External Events</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Target</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>checkStatus</td>
<td>FormRC</td>
<td>FormItem RC</td>
<td>Check if ready for execution</td>
</tr>
<tr>
<td>createScope</td>
<td>FormRC</td>
<td>DataModel</td>
<td>Creates a scope.</td>
</tr>
<tr>
<td>destroyScope</td>
<td>FormRC</td>
<td>DataModel</td>
<td>Delete a scope.</td>
</tr>
<tr>
<td>evaluate</td>
<td>FormRC</td>
<td>FormItem RC</td>
<td>Process form item being filled.</td>
</tr>
<tr>
<td>execute</td>
<td>FormRC</td>
<td>FormItem RCs</td>
<td>Start execution.</td>
</tr>
<tr>
<td>prepare</td>
<td>FormRC</td>
<td>FormItem RC</td>
<td>Initiates preparation needed before execution.</td>
</tr>
<tr>
<td>formItemResult</td>
<td>FormItemRC</td>
<td>FormRC</td>
<td>Results received by the form item.</td>
</tr>
<tr>
<td>prepared</td>
<td>FormItemRC</td>
<td>FormRC</td>
<td>Indicates that preparation is complete.</td>
</tr>
<tr>
<td>recoResult</td>
<td>PlayAndRecognize RC</td>
<td>FormRC</td>
<td>Results filled at the form level and not form item level.</td>
</tr>
</tbody>
</table>
</div>
<div class="div5">
<h6><a name="d3e3952" id="d3e3952" />6.9.2.1.4 State Chart
Representation</h6>
<img class="center" src="Images/FormRC.png"
alt="Form RC in UML State Chart" />
<p class="caption">Figure 11: Form RC States</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Note that the chart for SelectingItem:FormItemSelection is
missing. It will be defined later.</p>
</td>
</tr>
</table>
</div>
<div class="div5">
<h6><a name="d3e3964" id="d3e3964" />6.9.2.1.5 SCXML
Representation</h6>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml initialstate="Created">
<datamodel>
<data id="controller"/>
<data id="children"/>
<data id="activeItem"/>
<data id="active"/>
<data id="previousItem"/>
<data id="nextItem"/>
<data id="recoResult"/>
<data id="name"/>
<data id="JustFilled"/>
</datamodel>
<state id="Created">
<initial id="Idle"/>
<state id="Idle">
<onentry>
<assign loc="$controller" val="null"/>
<assign loc="$children" val="null"/>
<assign loc="$activeItem" val="null"/>
<assign loc="$active" val="false"/>
<assign loc="$previousItem" val="null"/>
<assign loc="$nextItem" val="null"/>
<assign loc="$recoResult" val="null"/>
<assign loc="$name" val="null"/>
</onentry>
<transition event="initialize" target="Initializing">
<assign name="$controller" expr="_eventData/controller"/>
</transition>
</state> <!-- end Idle -->
<state id="Initializing">
<datamodel>
<data id="childcounter"/>
</datamodel>
<onentry>
<assign loc="$childcounter" val="0"/>
<send target="datamodel" event="createScope" namelist="dialog"/>
<foreach var="child" array="$children">
<send target="$child/controller" event="initialize" namelist="$child/child"/>
</foreach>
</onentry>
<transition event="Initializing.done">
<assign loc="$childcounter" expr="$childcounter + 1"/>
</transition>
<transition event="Initializing.error">
<assign loc="$childcounter" expr="$childcounter + 1"/>
<send target="controller" event="initialize.error" namelist="_eventData/error_status"/>
</transition>
<transition event="Initializing.done" cond="$childcounter eq $children.size()-1" target="Ready">
<send target="controller" event="initialized"/>
</transition>
</state> <!-- end Initializing -->
<state id="Ready">
<onentry>
<assign loc="$active" val="false"/>
</onentry>
<transition event="execute" target="SelectingItem:FormItemSelection">
<assign loc="$active" value="true"/>
</transition>
<transition event="prepareGrammars" target="PreparingFormGrammars"/>
</state> <!-- end Ready -->
<state id="SelectingItem:FormItemSelection">
<onentry>
<send target="FormItemSelection" event="checkStatus" namelist="$children"/>
</onentry>
<transition event="SelectedFormItem.done" cond="activeItem eq 'null'" target="Exit"/>
<transition event="SelectedFormItem.done" cond="activeItem neq 'null'" target="PreparingItem"/>
</state> <!-- end SelectingItem:FormItemSelection -->
<state id="PreparingItem">
<onentry>
<send target="activeitem" event="prepare" />
</onentry>
<transition event="prepared" cond="_eventData/modal eq 'true'" target="Executing"/>
<transition event="prepared" cond="_eventData/modal eq 'false'" target="PreparingFormGrammars"/>
</state> <!-- end PreparingItem-->
<state id="Exit">
<onentry>
<send target="datamodel" event="destroyScope" namelist="dialog"/>
<send target="parent" event="done"/>
</onentry>
</state> <!-- end Exit-->
<state id="PreparingFormGrammars">
<transition event="PrepareFormGrammars.done" cond="active eq 'true'" target="PreparingOtherGrammars"/>
<transition event="PrepareFormGrammars.done" cond="active eq 'false'" target="PreparingOtherGrammars">
<send target="controller" event="prepared"/>
</transition>
</state> <!-- end PreparingFormGrammars -->
<state id="PreparingOtherGrammars">
<onentry>
<send target="controller" event="prepareGrammars"/>
</onentry>
<transition event="PrepareOtherGrammars.done" target="Executing"/>
</state> <!-- end PreparingOtherGrammars -->
<state id="Executing">
<onentry>
<send target="activeItem" event="execute"/>
</onentry>
<transition event="Executing.done" target="Active"/>
</state> <!-- end Executing -->
<state id="Active">
<onentry>
<assign loc="$JustFilled" expr="new Array()"/>
</onentry>
<transition event="fieldResult" target="Evaluating">
<insert pos="after" name="$JustFilled" val="currentitem"/>
</transition>
<transition event="PlayAndRecognize:RecogResult" target="ProcessingFormResult">
<insert pos="after" name="$JustFilled" val="currentitem"/>
</transition>
</state> <!-- end Active -->
<state id="ProcessingFormResult">
<onentry>
<foreach var="child" array="$children">
<if cond="$child.slotname eq _eventData/RecogResult/slotname">
<assign loc="$name" value="_eventData/RecogResult/name"/>
<insert pos="after" name="$JustFilled" val="$child"/>
<transition target="Evaluating"/>
</if>
</foreach>
</onentry>
<transition event="ProcessingFormResult.done" target="Evaluating"/>
</state> <!-- end ProcessingFormResult -->
<state id="Evaluating">
<onentry>
<send target="activeItem" event="evaluate"/>
</onentry>
<transition event="Evaluating.done" target="SelectingItem:FormItemSelection"/>
</state> <!-- end Executing -->
</state> <!-- end Created -->
</scxml>
</pre>
</div>
</div>
</div>
</div>
</div>
<div class="div2">
<h3><a name="FieldModule" id="FieldModule" />6.10 Field Module</h3>
<div class="div3">
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">There are several issues
still to be addressed in the Field module:
<ul>
<li>In the attribute table there's a Todo about naming
conventions.</li>
<li>The definition of the RC itself needs elaboration.</li>
<li>The play and recognize RC is incomplete.</li>
<li>The data model is not completely described.</li>
</ul>
</td>
</tr>
</table>
<h4><a name="d3e3972" id="d3e3972" />6.10.1 Syntax</h4>
<a name="field:attributes" id="field:attributes" />
<table>
<caption>Table 41: Table: <field> Attributes</caption>
<tbody>
<tr>
<th>name</th>
<td>The form item variable in the dialog scope that will hold the
result. The name must be unique among form items in the form. If
the name is not unique, then a badfetch error is thrown when the
document is fetched. The name must conform to the variable naming
conventions in (TODO).</td>
</tr>
<tr>
<th>expr</th>
<td>The initial value of the form item variable; default is
ECMAScript undefined. If initialized to a value, then the form item
will not be visited unless the form item variable is cleared.</td>
</tr>
<tr>
<th>cond</th>
<td>An expression that must evaluate to true after conversion to
boolean in order for the form item to be visited. The form item can
also be visited if the attribute is not specified.</td>
</tr>
<tr>
<th>type</th>
<td>The type of field, i.e., the name of a builtin grammar type (<a
href="#BuiltinModule"><b>6.11 Builtin Grammar Module</b></a>). Note
that platform support for builtin grammar types is optional. If the
specified builtin type is not supported by the platform, an
error.unsupported.builtin event is thrown.</td>
</tr>
<tr>
<th>slot</th>
<td>The name of the grammar slot used to populate the variable (if
it is absent, it defaults to the variable name). This attribute is
useful in the case where the grammar format being used has a
mechanism for returning sets of slot/value pairs and the slot names
differ from the form item variable names.</td>
</tr>
<tr>
<th>modal</th>
<td>If this is false (the default) all active grammars are turned
on while collecting this field. If this is true, then only the
field's grammars are enabled: all others are temporarily
disabled.</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="d3e4024" id="d3e4024" />6.10.2 Semantics</h4>
<p>The semantics of field elements are defined using the following
resource controllers: Field (<a href="#RC:Field"><b>6.10.2.1 Field
RC</b></a>), PlayandRecognize (<a
href="#RC:PlayAndRecognize"><b>6.10.2.2 PlayandRecognize
RC</b></a>), ...</p>
<div class="div4">
<h5><a name="RC:Field" id="RC:Field" />6.10.2.1 Field RC</h5>
<p>The Field Resource Controller is the primary RC for the field
element.</p>
<div class="div5">
<h6><a name="d3e4038" id="d3e4038" />6.10.2.1.1 Definition</h6>
<p>The field RC is defined in terms of a data model and state
model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this field RC</li>
<li>children: array of children's (primary) RC</li>
<li>includePrompts: boolean indicating whether prompts are to be
played. Default: true.</li>
<li>counter: prompt counter. Default: 1.</li>
<li>recoResult: ??</li>
<li>name:</li>
<li>expr:</li>
<li>cond:</li>
<li>modal:</li>
<li>slot:</li>
</ul>
<p></p>
<p>The field RC's state model consists of the following states:
Idle, Initializing, Ready, Preparing, Prepared, Executing and
Evaluating.</p>
<p>While in the Idle state, the RC may receive an 'initialize'
event, whose 'controller' event data is used to update the data
model. The RC then transitions into Initiating state.</p>
<p>In the Initializing state, the RC creates a variable in the
Datamodel Resource: the variable name corresponds to the name in
the RC's data model, and the variable value is set to the value of
the RC's data model expr, if this is defined. The field RC then
initializes its children: this is modeled as a separate RC (see
XXX). When all children are initialized, the RC transitions to the
Ready state.</p>
<p>In the Ready state, the field RC can receive an 'checkStatus'
event to check whether it can be executed or not. The value of name
and cond in its data model are checked: the status is true if the
name is undefined and the value of cond evaluates to true. The
status is returned in a 'checkedStatus' event sent back to the
controller RC. If the RC receives a 'prepare' event, it updates
includePrompts in its data model using the event data, and
transitions to the Preparing state.</p>
<p>In the Preparing state, the field prepares its prompts and
grammars. Prompts are prepared only if the includePrompts data is
true; otherwise, prompts within the field are not prepared (e.g.
field prompts aren't queued following a <reprompt>).
Preparation of prompts is modeled as a separate RC (see XXX), as is
preparation of grammars (see YYY). These RCs are summarized
below.</p>
<p>Prompts are prepared by iterating through the children array. In
the iteration, each prompt RC child is sent a 'checkStatus' event.
If the prompt child returns true (its cond parameter evaluates to
true), then it is added to a 'correct count' list together with its
count. Once the iteration is complete, the RC determines the
highest count on the 'correct count' list: the highest count among
those on the list less than or equal to the current count value.
All child on the 'correct count' list whose count is not the
highest count are removed. The RC then iterates through the
'correct count' list and sends an 'execute' event to each prompt
RC, causing it to be queued on the PromptQueue Resource.</p>
<p>Grammars are prepared by recursing through the children array
and sending each grammar RC child an 'execute' event. The grammar
RC then, if appropriate, sends an 'addGrammar' event to the DTMF or
ASR Recognizer Resource where the grammar itself, its properties
and the field RC is sent as the handler for recognition
results.</p>
<p>When prompts and grammars have been prepared, the prompt counter
is incremented and the field RC sends a 'prepared' event to its
controller with event data indicating its modal status and then
transition into the Prepared state.</p>
<p>In the Prepared state, the field RC may receive an 'execute'
event from its controller. The RC sends an 'execute' event to the
PlayAndRecognize RC (<a href="#RC:PlayAndRecognize"><b>6.10.2.2
PlayandRecognize RC</b></a>), causing any queued prompts to be
played and recognition to be initiated. In the event data, the
controller is set to this RC, and other data is derived from data
model properties. The RC transitions to the Executing state.</p>
<p>In the Executing state, the PlayAndRecognize RC must send
recoResults (or error events: noinput, nomatch, error.semantic) to
the field RC.</p>
<p>If the field RC receives the recoResults, then it updates its
name variable in the Datamodel Resource. The field RC then sends a
'fieldResult' event to its controller indicating that a field
result has been received and processed.</p>
<p>If the recoResult is received by the field RC's controller, then
the field receives an 'evaluate' event which causes it to
transition to the Evaluating state.</p>
<p>In the Evaluating state, the field RC iterates through its
children executing each filled RC: this is modeled by a separate RC
(see XXX). When evaluation is complete, the RC sends a 'evaluated'
event to its controller and transitions to the Ready state.</p>
</div>
<div class="div5">
<h6><a name="d3e4095" id="d3e4095" />6.10.2.1.2 Defined Events</h6>
<p>The Field RC is defined to receive the following events:</p>
<table>
<caption>Table 42: Events received by Field RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialize</td>
<td>any</td>
<td>controller(M)</td>
<td /></tr>
<tr>
<td>checkStatus</td>
<td>controller</td>
<td />
<td /></tr>
<tr>
<td>prepare</td>
<td>controller</td>
<td>includePrompts (M)</td>
<td /></tr>
<tr>
<td>execute</td>
<td>controller</td>
<td />
<td /></tr>
<tr>
<td>evaluate</td>
<td>controller</td>
<td />
<td /></tr>
</tbody>
</table>
<p>and the events it sends:</p>
<table>
<caption>Table 43: Events sent by Field RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialized</td>
<td>controller</td>
<td />
<td /></tr>
<tr>
<td>checkedStatus</td>
<td>controller</td>
<td />
<td /></tr>
<tr>
<td>prepared</td>
<td>controller</td>
<td />
<td /></tr>
<tr>
<td>fieldResult</td>
<td>controller</td>
<td />
<td /></tr>
<tr>
<td>evaluated</td>
<td>controller</td>
<td />
<td /></tr>
</tbody>
</table>
<p></p>
</div>
<div class="div5">
<h6><a name="d3e4202" id="d3e4202" />6.10.2.1.3 External
Events</h6>
<p>Table 44 shows the events sent and received by the field RC to
resources and other RCs which define the events.</p>
<a name="field:external-events" id="field:external-events" />
<table>
<caption>Table 44: Field RC External Events</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Target</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>create</td>
<td>FieldRC</td>
<td>DataModel</td>
<td /></tr>
<tr>
<td>assign</td>
<td>FieldRC</td>
<td>DataModel</td>
<td /></tr>
<tr>
<td>execute</td>
<td>FieldRC</td>
<td>PlayandRecognizeRC</td>
<td /></tr>
<tr>
<td>recoResult</td>
<td>PlayandRecognizeRC</td>
<td>FieldRC</td>
<td /></tr>
</tbody>
</table>
</div>
<div class="div5">
<h6><a name="d3e4254" id="d3e4254" />6.10.2.1.4 State Chart
Representation</h6>
<img class="center" src="Images/field.png"
alt="Field RC in UML State Chart" />
<p class="caption">Figure 12: Field RC States</p>
</div>
<div class="div5">
<h6><a name="d3e4260" id="d3e4260" />6.10.2.1.5 SCXML
Representation</h6>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml initialstate="Created">
<datamodel>
<data id="controller"/>
<data id="children"/>
<data id="counter"/>
<data id="recoResult"/>
<data id="cond"/>
<data id="name"/>
<data id="expr"/>
<data id="modal"/>
<data id="includePrompts"/>
</datamodel>
<state id="Created">
<initial id="Idle"/>
<state id="Idle">
<onentry>
<assign location="$controller" val="null"/>
<assign location="$children" expr="new Array()"/>
<assign location="$counter" val="1"/>
<assign location="$recoResult" val="null"/>
<assign location="$cond" val="null"/>
<assign location="$expr" val="null"/>
<assign location="$modal" val="false"/>
<assign location="$includePrompts" val="true"/>
</onentry>
<transition event="initialize" target="Initializing">
<assign name="$controller" expr="_eventData/controller"/>
</transition>
</state>
<!-- end Idle -->
<state id="Initializing">
<datamodel>
<data id="childcounter"/>
</datamodel>
<onentry>
<if cond="expr neq 'null'">
<send target="datamodel" event="assign" namelist="$name, $expr"/>
<else>
<send target="datamodel" event="create" namelist="$name"/>
</else>
</if>
<assign location="$childcounter" val="0"/>
<foreach var="child" array="$children">
<send target="$child/controller" event="initialize"/>
</foreach>
</onentry>
<transition event="Initializing.done">
<assign location="$childcounter" expr="$childcounter + 1"/>
</transition>
<transition event="Initializing.error">
<assign location="$childcounter" expr="$childcounter + 1"/>
<send target="controller" event="initialize.error" namelist="_eventData/error_status"/>
</transition>
<transition event="Initializing.done" cond="$childcounter eq $children.size()-1" target="Ready">
<send target="controller" event="initialized"/>
</transition>
</state>
<!-- end Initializing -->
<state id="Ready">
<transition event="checkStatus" >
<assign location="$status" expr="checkStatus()"/>
<send target="controller" event="checkedStatus" namelist="_eventData/status"/>
</transition>
<transition event="prepare" target="Preparing">
<assign location="$includePrompts" expr="_eventData/includePrompts"/>
</transition>
</state>
<!-- end Ready -->
<state id="Preparing">
<onentry>
<if cond="$includePrompts eq 'true'">
<send target="Prompts RC" event="initialize"/>
</if>
<send target="Grammars RC" event="initialize"/>
</onentry>
<transition event="preparing.done" target="Prepared">
<send target="controller" event="prepared" namelist="modal"/>
</transition>
</state>
<!-- end Preparing -->
<state id="Prepared">
<transition event="execute" target="Executing">
<send target="PlayAndRecognize" event="execute" namlist="self, inputmodes"/>
</transition>
</state>
<!-- end Prepared-->
<state id="Executing">
<datamodel>
<data id="value"/>
</datamodel>
<transition event="playAndReco:recoResult">
<assign location="$value" expr="processResults($name, slot, _eventdata/result)"/>
<send target="datamodel" event="assign" namelist="$name, $value"/>
<send target="parent" event="fieldResult"/>
</transition>
</state>
<!-- end Executing-->
<state id="Evaluating">
<onentry>
<send target="filled RC" event="executeFilleds"/>
</onentry>
<transition event="evaluating.done" target="Ready">
<send target="controller" event="evaluated"/>
</transition>
</state>
<!-- end Evaluating-->
</state>
<!-- end Created -->
</scxml>
</pre>
</div>
</div>
</div>
<div class="div4">
<h5><a name="RC:PlayAndRecognize"
id="RC:PlayAndRecognize" />6.10.2.2 PlayandRecognize RC</h5>
<p>The PlayandRecognize RC coordinates media input with Recognizer
resources and media output with the PromptQueue Resource.</p>
<p>The following use cases are covered:</p>
<ol class="enumar">
<li>Bargein is not active and bargeintype is speech. Prompts are
played to completion and the user provides positive input, negative
input or no input.</li>
<li>Bargein is active and bargeintype is speech. Prompts are played
to completion and the user provides positive input, negative input
or no input.</li>
<li>Bargein is active and bargeintype is speech. User interrupts
prompts and the user provides positive input, negative input or no
input.</li>
<li>Bargein is not active and bargeintype is hotword. Prompts are
played to completion and the user provides positive input, negative
input or no input. User may provide a positive input after one or
more negative inputs. The 'nomatch' event is never generated.</li>
<li>Bargein is active and bargeintype is hotword. User interrupts
prompts and the user provides positive input, negative input or no
input. User may provide a positive input after one or more negative
inputs. The 'nomatch' event is never generated.</li>
<li>Prompt sequences alternating between bargein and no
bargein.</li>
<li>Prompt sequences alternating between speech and hotword
bargeintype.</li>
</ol>
<p></p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Open issue: should we
remove the possibility for alternating speech and hotword bargein
modes within the recognition cycle?</td>
</tr>
</table>
<div class="div5">
<h6><a name="d3e4291" id="d3e4291" />6.10.2.2.1 Definition</h6>
<p>The PlayandRecognize RC coordinates media input with recognition
resources and media output with the PromptQueue Resource on behalf
of a form item.</p>
<p>This RC activates prompt queue playback, activates recognition
resources, manages bargein behavior and handles results from
recognition resources.</p>
<p>The RC is defined in terms of a data model and a state
model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this RC</li>
<li>bargein: Boolean indicates whether bargein is active or not.
Default: true.</li>
<li>bargeintype: indicates the type of bargein, if active. Default:
speech.</li>
<li>inputmodes: active recognition input modes. Default: voice and
dtmf.</li>
<li>inputtimeout: timeout to wait for input. Default: 0s. (Required
since the prompt queue may be empty).</li>
<li>dtmfProps: DTMF properties</li>
<li>asrProps: Speech recognition properties</li>
<li>maxnbest: maximum number of nbest results. Default: 1.</li>
<li>recoActive: boolean indicating whether recognition is active.
Default: false.</li>
<li>markname: string indicating current markname. Default:
null</li>
<li>marktime: time designator indicating current marktime. Default:
0s.</li>
<li>recoResult:</li>
<li>recoListener:</li>
<li>activeGrammars: Boolean indicating whether grammars are active.
Default: false.</li>
</ul>
<p></p>
<p>The RC model consists of the following states: idle, prepare
recognition resources, start playing, playing prompts with bargein,
playing prompts without bargein, recognizing with a timer, waiting
for input, waiting for speech result and update results. The
complexity of this model is partially a consequence of supporting
the relationship between hotword bargein and recognition result
processing.</p>
<p>While in the idle state, the RC may receive an 'execute' event,
whose event data is used to update the data model. The event
information includes: controller, inputmodes, inputtimeout,
dtmfProps, asrProps and maxnbest. The RC transition to the prepare
recognition resources state.</p>
<p>In the prepare recognition resources, the RC sends 'prepare'
events to the ASR and DTMF recognition resource. Both events
specify this RC as the controller parameter, while the properties
parameter differs. In this state, the RC can received 'prepared' or
'notPrepared' events from either recognition resources. If neither
resource returns a 'prepared' event, then activeGrammars is false
(i.e. no active DTMF or speech grammar) and the RC sends an
'error.semantic' event to the controller and exits. If at least one
resource returns a 'prepared' event, then the RC moves into the
start playing state.</p>
<p>The start playing state begins by sending the PromptQueue
resource a 'play' event. The PromptQueue responds with a 'playDone'
event if there are no prompt in the prompt queue; as a result, this
RC moves into the start recognizing with timer state. If there is
at least one prompts in the queue, the PromptQueue sends this RC a
'playStarted' event whose data contains the bargein and bargeintype
values for the first prompt, and the input timeout value for the
last prompt in the queue. The data model is updated with this
information.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Open issue: PromptQueue
Resource doesn't currently have playStarted event. If we don't add
playStarted event, then is there a better way to get the bargein,
bargeintype, and timeout information from the prompts in the
PromptQueue?</td>
</tr>
</table>
<p>Interaction with the recognizer during prompt playback is
determined by the data model's bargein value. If bargein is true,
then this RC transitions to the playing with bargein state. If
bargein is false, the RC transitions to the playing without bargein
state.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Open Issue: The event
"bargeinChange" as a one way notification could pose a problem, as
it takes finite time for recognizer to suspend or resume. This
might work better if PromptQueue Resource waited for an event
"bargeinChangeAck" (or similar) from PlayandRecognize RC before
starting the next play. PlayandRecognize RC will send the event
"bargeinChangeAck" after it completed suspend or resume action on
the recognizer.</td>
</tr>
</table>
<p>In the playing without bargein state, recognition is suspended
if it has been previously activated (recoActive parameter of the
data model tracks this). Suspending recognition is conditional on
the value of 'inputmodes' data parameter; if 'dtmf' is in
inputmodes, then DTMF recognition is suspended; if 'voice' is in
inputmodes, the ASR recognition is suspended. In this state, the
PromptQueue can report to this RC changes in bargein and
bargeintype as prompts are played: a 'bargeintypeChange' event with
the values 'hotword' or 'speech' cause the data model parameter
'bargein' to the set to 'true' and the 'bargeintype' parameter to
be updated with event data value. If the PromptQueue resource sends
a 'playDone' event, then the data model markname and marktime
parameters are updated and the RC transitions to the start
recognizing with timer state.</p>
<p>In the playing with bargein state, recognition is activated if
it has not been previously activated (determined by recoActive
parameter in the data model). Activating recognition is conditional
on the value of 'inputmodes' data parameter; if 'dtmf' is in
inputmodes, then DTMF recognition is activated; if 'voice' is in
inputmodes, then ASR recognition is activated. In this state, the
PromptQueue can report changes in bargein and bargeintype as
prompts are played: a 'bargeintypeChange' event where the event
data value is not 'unbargeable' causes the data model 'bargeintype'
parameter to be updated with the event data ('hotword' or
'speech'); while a 'bargeintypeChange' where the event data value
is 'unbargeable' causes the data model 'bargein' parameter to set
to false and the RC transitions to the playing without bargein
state. If the PromptQueue resources sends a 'playDone' event, then
the data model markname and marktime parameters are updated and the
RC transitions to the start recognizing with timer state.</p>
<p>Recognition handling in this state depends upon the bargeintype
data parameter. If the bargeintype is 'speech' and a recognizer
sends a 'inputStarted' event, then the RC transition to the waiting
for speech result state. If the bargeintype is 'hotword', then
recognition results are processed within this state. In particular,
if a recognition resource sends a 'recoResults' event, then its
event data is processed to determine if the recognition result is
positive or negative.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">Further details on
recognition processing to be added in later versions. recoResults
data parameter is updated with the recognition results (truncated
to maxnbest). A speech result is positive iff there is at least one
result whose confidence level is equal to or greater than the
recognition confidence level; otherwise the result is negative.
DTMF results are always positive. The recoListener data parameter
is defined as the listener associated with the best result if the
result is positive.</td>
</tr>
</table>
<p>If positive, the RC sends the PromptQueue a 'halt' event, and
transitions to the update results state. If negative, the RC sends
a 'listen' event to the recognition resource which sent the
'recoResults' event.</p>
<p>In the start recognizing with timer state, an input timer is
activated for the value of the inputtimeout data parameter and, if
the recognition is not already active (determined by the recoActive
data parameter). Recognition activation is conditional on the value
of 'inputmodes' data parameter; if 'dtmf' is in inputmodes, then
DTMF recognition is activated; if 'voice' is in inputmodes, the ASR
recognition is activated. The RC then transitions into the waiting
for input state.</p>
<p>In the waiting for input state, the RC waits for user input. If
it receives a 'timerExpired' event, then the RC sends a 'stop'
event to all recognition resources, sends a 'noinput' event to its
controller and exits. Recognition handling in this state depends
upon the bargeintype data parameter. If the bargeintype is 'speech'
and a recognizer sends a 'inputStarted' event, then the RC
transition to the waiting for speech result state. If the
bargeintype is 'hotword', then recognition results are processed
within this state. In particular, if a recognition resource sends a
'recoResults' event, then its event data is processed to determine
if the recognition result is positive or negative. If positive, the
RC cancels the timer, and transitions to the update results state.
If negative, the RC sends a 'listen' event to the recognition
resource which sent the 'recoResults' event.</p>
<p>In the waiting for speech result state, the RC waits for a
'recoResult' event whose data is used to update the recoResult data
parameter and to set the recoListener data parameter if the
recognition result is positive. The RC then transitions to the
update results state.</p>
<p>In the update results state, the RC sends 'assign' events to the
data model resource, so that the lastresult object in application
scope is updated with recognition results as well as markname and
marktime information. If the recoListener data parameter is
defined, then the RC sends a 'recoResult' event to the recognition
listener RC; otherwise, it sends 'nomatch' event to its controller.
The RC then exits.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Open issue: Behavior if one reco resource sends 'inputStarted'
but other sends 'recoResults'? Race conditions between recognizers
returning results? (This problem is inherent to the presence of two
recognizers. For the sake of clear semantics, we could restrict
only one recognizer to respond with 'inputStarted' and
'recoResults'. The other recognizer is always 'stopped'. But a
better choice might be to have only one recognizer that handles
both DTMF and speech, since semantically both recognizers are very
similar.)</p>
</td>
</tr>
</table>
</div>
<div class="div5">
<h6><a name="d3e4373" id="d3e4373" />6.10.2.2.2 Defined Events</h6>
<p>The PlayandRecognize RC is defined to receive the following
events:</p>
<a name="playandrecognize:incoming"
id="playandrecognize:incoming" />
<table>
<caption>Table 45: Events received by PlayandRecognize RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>execute</td>
<td>any</td>
<td>controller(M), inputmodes (O), inputtimeout (O), dtmfProps (M),
recoProps (M), maxnbest (O)</td>
<td /></tr>
</tbody>
</table>
<p>and the events it sends:</p>
<a name="playandrecognize:outbound"
id="playandrecognize:outbound" />
<table>
<caption>Table 46: Events sent by PlayandRecognize RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Sequencing</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>recoResult</td>
<td>any</td>
<td>results (M)</td>
<td>one-of: nomatch, noinput, error.*, recoResult</td>
<td /></tr>
<tr>
<td>nomatch</td>
<td>controller</td>
<td />
<td>one-of: nomatch, noinput, error.*, recoResult</td>
<td /></tr>
<tr>
<td>noinput</td>
<td>controller</td>
<td />
<td>one-of: nomatch, noinput, error.*, recoResult</td>
<td /></tr>
<tr>
<td>error.semantic</td>
<td>controller</td>
<td />
<td>one-of: nomatch, noinput, error.*, recoResult</td>
<td /></tr>
<tr>
<td>error.badfetch.grammar</td>
<td>controller</td>
<td />
<td>one-of: nomatch, noinput, error.*, recoResult</td>
<td /></tr>
<tr>
<td>error.noresource</td>
<td>controller</td>
<td />
<td>one-of: nomatch, noinput, error.*, recoResult</td>
<td /></tr>
<tr>
<td>error.unsupported.builtin</td>
<td>controller</td>
<td />
<td>one-of: nomatch, noinput, error.*, recoResult</td>
<td /></tr>
<tr>
<td>error.unsupported.format</td>
<td>controller</td>
<td />
<td>one-of: nomatch, noinput, error.*, recoResult</td>
<td /></tr>
<tr>
<td>error.unsupported.language</td>
<td>controller</td>
<td />
<td>one-of: nomatch, noinput, error.*, recoResult</td>
<td /></tr>
</tbody>
</table>
<p></p>
</div>
<div class="div5">
<h6><a name="d3e4500" id="d3e4500" />6.10.2.2.3 External
Events</h6>
<p>The events in Table 47 are sent by the PlayandRecognize RC to
resources which define the events.</p>
<a name="playandrecognize:ext-outbound"
id="playandrecognize:ext-outbound" />
<table>
<caption>Table 47: External Events sent by PlayandRecognize
RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>play</td>
<td>PromptQueue</td>
<td />
<td /></tr>
<tr>
<td>halt</td>
<td>PromptQueue</td>
<td />
<td /></tr>
<tr>
<td>prepare</td>
<td>Recognizer</td>
<td />
<td /></tr>
<tr>
<td>listen</td>
<td>Recognizer</td>
<td />
<td /></tr>
<tr>
<td>suspend</td>
<td>Recognizer</td>
<td />
<td /></tr>
<tr>
<td>stop</td>
<td>Recognizer</td>
<td />
<td /></tr>
</tbody>
</table>
<p>The events in Table 48 are received by this RC. Their definition
is provided by the sending component.</p>
<a name="playandrecognize:ext-incoming"
id="playandrecognize:ext-incoming" />
<table>
<caption>Table 48: External Events received by PlayandRecognize
RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Sequencing</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>playStarted</td>
<td>PromptQueue</td>
<td>bargein (O), bargeintype (O), inputtimeout (O)</td>
<td>pq:play notification</td>
<td /></tr>
<tr>
<td>playDone</td>
<td>PromptQueue</td>
<td>markname (O), marktime (O)</td>
<td>pq:play response</td>
<td /></tr>
<tr>
<td>bargeinChange</td>
<td>PromptQueue</td>
<td>bargein (M)</td>
<td />
<td /></tr>
<tr>
<td>bargeintypeChange</td>
<td>PromptQueue</td>
<td>bargeintype (M)</td>
<td />
<td /></tr>
<tr>
<td>prepared</td>
<td>Recognizer</td>
<td />
<td>prepare positive response</td>
<td /></tr>
<tr>
<td>notPrepared</td>
<td>Recognizer</td>
<td />
<td>prepare negative response</td>
<td /></tr>
<tr>
<td>inputStarted</td>
<td>Recognizer</td>
<td />
<td />
<td /></tr>
<tr>
<td>recoResult</td>
<td>Recognizer</td>
<td>results (M), listener (O)</td>
<td />
<td /></tr>
</tbody>
</table>
</div>
<div class="div5">
<h6><a name="d3e4656" id="d3e4656" />6.10.2.2.4 State Chart
Representation</h6>
<p>The main states for the PlayandRecognize RC are shown in Figure
13.</p>
<img class="center" src="Images/PlayAndRecognizeRC.png"
alt="Play and Recognize RC States" />
<p class="caption">Figure 13: PlayandRecognize RC States</p>
</div>
<div class="div5">
<h6><a name="d3e4666" id="d3e4666" />6.10.2.2.5 SCXML
Representation</h6>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml initialstate="Created">
<datamodel>
<data id="controller"/>
<data id="bargein"/>
<data id="bargeintype"/>
<data id="inputmodes"/>
<data id="inputtimeout"/>
<data id="dtmfProps"/>
<data id="asrProps"/>
<data id="maxnbest"/>
<data id="recoActive"/>
<data id="markname"/>
<data id="marktime"/>
<data id="recoResult"/>
<data id="recoListener"/>
<data id="activeGrammars"/>
</datamodel>
<state id="Created">
<initial id="Idle"/>
<state id="Idle">
<onentry>
<assign location="$controller" val="null"/>
<assign location="$bargein" expr="true"/>
<assign location="$bargeintype" val="speech"/>
<assign location="$inputmodes" val="voice"/>
<assign location="$inputtimeout" val="0s"/>
<assign location="$dtmfProps" val="null"/>
<assign location="$asrProps" val="null"/>
<assign location="$maxbest" val="1"/>
<assign location="$recoActive" val="false"/>
<assign location="$markname" val="null"/>
<assign location="$marktime" val="0"/>
<assign location="$recoResult" val="null"/>
<assign location="$recoListener" val="null"/>
<assign location="$activeGrammars" val="false"/>
</onentry>
<transition event="execute" target="PrepareRecognitionResources">
<assign name="/datamodel/data/[@name='controller']" expr="_eventData/controller"/>
<assign name="/datamodel/data/[@name='inputmodes']" expr="_eventData/modes"/>
<assign name="/datamodel/data/[@name='inputtimeout']" expr="_eventData/timeout"/>
<assign name="/datamodel/data/[@name='dtmfProps']" expr="_eventData/dtmfProps"/>
<assign name="/datamodel/data/[@name='asrProps']" expr="_eventData/asrProps"/>
<assign name="/datamodel/data/[@name='maxnbest']" expr="_eventData/maxnbest"/>
</transition>
</state>
<!-- end Idle -->
<state id="PrepareRecognitionResources">
<transition target="StartPlaying" cond="$activeGrammars eq 'true'"/>
<transition target="Exit" cond="$activeGrammars eq 'false'">
<send target="controller" event="error.semantic"/>
</transition>
</state>
<!-- end PrepareRecognitionResources -->
<state id="StartPlaying">
<onentry>
<send target="PromptQueue" event="pq:play"/>
</onentry>
<transition event="pq:playStarted" cond="$bargein eq 'true'" target="PlayingWithBargein">
<assign location="$bargein" expr="_eventdata/bargein"/>
</transition>
<transition event="pq:playStarted" cond="$bargein eq 'false'" target="PlayingWithoutBargein">
<assign location="$bargein" expr="_eventdata/bargein"/>
</transition>
<transition event="pq:playDone" target="StartRecognizingWithTimer"/>
</state>
<!-- end StartPlaying -->
<state id="PlayingWithoutBargein">
<onentry>
<if cond="$recoActive eq 'true'">
<if cond="in('dtmf',$inputmodes) ">
<send target="DTMFRecognizer" event="rec:suspend"/>
</if>
<if cond="in('voice',$inputmodes) ">
<send target="DTMFRecognizer" event="rec:suspend"/>
</if>
</if>
</onentry>
<transition event="bargeintypeChange" cond="_eventdata/value neq 'unbargeable'" target="PlayWithBargein">
<assign location="$bargein" val="true"/>
<assign location="$bargeintype" expr="_eventdata/value"/>
</transition>
<transition event="pq:playDone" target="StartRecognizingWithTimer">
<assign location="$markname" expr="_eventdata/markname"/>
<assign location="$marktime" expr="_eventdata/marktime"/>
</transition>
</state>
<!-- end PlayingWithoutBargein -->
<state id="PlayingWithBargein">
<datamodel>
<data id="negorpos"/>
</datamodel>
<onentry>
<if cond="in('dtmf',$inputmodes) ">
<send target="DTMFRecognizer" event="rec:listen"/>
</if>
<if cond="in('voice',$inputmodes)">
<send target="DTMFRecognizer" event="rec:listen"/>
</if>
<assign location="$recoActive" val="true"/>
</onentry>
<transition event="bargeintypeChange" cond="_eventdata/value neq 'unbargeable'">
<assign location="$bargeintype" expr="_eventdata/value"/>
</transition>
<transition event="rec:recoResult">
<assign location="$negorpos" expr="processRecoResult()"/>
<send target="parent" event="negorpos"/>
</transition>
<transition event="negativeRecoResult">
<send target="rec_source" event="listen"/>
</transition>
<transition event="pq:playDone" target="StartRecognizingWithTimer">
<assign location="$markname" expr="_eventdata/markname"/>
<assign location="$marktime" expr="_eventdata/marktime"/>
</transition>
<transition event="positiveRecoResult">
<send target="PromptQueue" event="pq:halt"/>
</transition>
<transition event="rec:inputStarted" cond="$bargeintype eq 'speech'">
<send target="PromptQueue" event="pq:halt"/>
</transition>
</state>
<!-- end PlayingWithBargein -->
<state id="StartRecognizingWithTimer">
<onentry>
<send target="Timer" event="start" namelist="$inputtimeout"/>
<if cond="$recoActive eq 'false'">
<if cond="in('dtmf',$inputmodes) ">
<send target="DTMFRecognizer" event="rec:listen"/>
</if>
<if cond="in('voice',$inputmodes)">
<send target="DTMFRecognizer" event="rec:listen"/>
</if>
<assign location="$recoActive" val="true"/>
</if>
</onentry>
<transition event="execute" target="Executing">
<send target="PlayAndRecognize" event="execute" namlist="self, inputmodes"/>
</transition>
</state>
<!-- end StartRecognizingWithTimer-->
<state id="WaitingForInput">
<datamodel>
<data id="negorpos"/>
</datamodel>
<transition event="rec:recoResult">
<assign location="$negorpos" expr="processResults()"/>
<send target="parent" event="negorpos"/>
</transition>
<transition event="negativeRecoResult">
<send target="rec_source" event="listen"/>
</transition>
<transition event="timerExpired">
<send target="Recognizer" event="rec:stop"/>
<send target="controller" event="noinput"/>
</transition>
<transition event="rec:inputStarted" cond="$bargeintype eq 'speech'" target="WaitingForSpeechResult">
<send target="Timer" event="cancel"/>
</transition>
</state>
<!-- end WaitingForInput-->
<state id="WaitingForSpeechResult">
<datamodel>
<data id="negorpos"/>
</datamodel>
<!--TBD: the original diagram seems put the event at the wrong place-->
<transition event="rec:recoResult" target="UpdateResults">
<assign location="$negorpos" expr="processResults()"/>
<send target="parent" event="negorpos"/>
</transition>
</state>
<!-- end WaitingForSpeechResult-->
<state id="UpdateResults">
<onentry>
<send target="datamodel" namelist="application, lastresult$, recoResults"/>
<if cond="$negorpos neq 'null'">
<send target="recoListener" event="recoResult" namelist="recoResults"/>
<else/>
<send target="controller" event="nomatch"/>
</if>
</onentry>
<transition target="Exit"/>
</state>
<!-- end UpdateResults-->
</state>
<!-- end Created -->
</scxml>
</pre>
</div>
</div>
</div>
</div>
</div>
<div class="div2">
<h3><a name="BuiltinModule" id="BuiltinModule" />6.11 Builtin
Grammar Module</h3>
<div class="div3">
<h4><a name="d3e4674" id="d3e4674" />6.11.1 Usage of Platform
Grammars</h4>
<p>VoiceXML developers are commonly required to sketch out an
application for the purpose of a demo or other proof of concept. In
such cases, it is convenient to use placeholder grammars for
frequent dialogs like collecting a date, asking a yes/no question,
etc. Builtin grammars (provided by the platform) are designed to
serve this purpose.</p>
<p>Once the prototyping phase is complete, however, it is good
practice to replace the builtin grammar references with developer
written grammars. There are several reasons behind this
suggestion:</p>
<ul>
<li>There is little consistency of the builtin implementations
across platforms. Relying on builtins complicates portability.</li>
<li>Application developers typically have no control over the
coverage in the builtin grammar. This means that any modification
to the accepted phrase(s) would require a completely new grammar.
Discovering a limitation like this post-deployment could be
disruptive.</li>
<li>Similar to the above, builtins are limited in their ability to
handle underspecified spoken input. For instance, "20 peso" cannot
be resolved to a specific [ISO4217] currency code because the
"peso" is the name of the currency of numerous nations. In such
cases the platform may return a specific currency code according to
the language or may omit the currency code. Edge cases like this
are not likely to be handled by platform builtins.</li>
</ul>
</div>
<div class="div3">
<h4><a name="d3e4688" id="d3e4688" />6.11.2 Platform
Requirements</h4>
Support for builtin grammars is not required for conformance. But
if a platform does support builtin types, then it MUST follow the
description given in this module as closely as possible. This
includes:
<ul>
<li>Supporting all builtin types for a given language. In other
words, if a platform supports one builtin in a language, then it
ought to support the others as well.</li>
<li>Following the type descriptions listed in the "Syntax and
Semantics" section below. This requirement is primarily designed to
ensure at least some amount of consistency on how the NL from the
grammar is accessed.</li>
<li>Supporting both voice and DTMF modes for each type.</li>
<li>Supporting the corresponding <say-as> class for the
grammar type.</li>
</ul>
</div>
<div class="div3">
<h4><a name="d3e4701" id="d3e4701" />6.11.3 Syntax and
Semantics</h4>
<p>Builtin grammars may be specified in one of two ways:</p>
<ul>
<li>Through the "type" attribute on the <field> tag (see
Table 41). For example <field type="boolean">. Note that when
a builtin is specified in this way, it is in addition to any
<grammar> under the <field></li>
<li>Using the "builtin" protocol for the grammar URI. For example:
<grammar src="builtin:boolean"/></li>
</ul>
<p></p>
<p>Each builtin type has a convention for the format of the value
returned. These are independent of language and of the
implementation. The return type for builtin fields is a string
except for the boolean field type. To access the actual recognition
result, the author can reference the <field> shadow variable
"name$.utterance". Alternatively, the developer can access
application.lastresult$, where
application.lastresult$.interpretation has the same string value as
application.lastresult$.utterance.</p>
<p />
<table>
<caption>Table 49: Builtin Grammar Types</caption>
<thead>
<tr>
<td>Type</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>boolean</td>
<td>Inputs include affirmative and negative phrases appropriate to
the current language. DTMF 1 is affirmative and 2 is negative. The
result is ECMAScript true for affirmative or false for negative.
The value will be submitted as the string "true" or the string
"false". If the field value is subsequently used in <say-as>
with the interpret-as value "vxml:boolean", it will be spoken as an
affirmative or negative phrase appropriate to the current
language.</td>
</tr>
<tr>
<td>date</td>
<td>Valid spoken inputs include phrases that specify a date,
including a month day and year. DTMF inputs are: four digits for
the year, followed by two digits for the month, and two digits for
the day. The result is a fixed-length date string with format
yyyymmdd, e.g. "20000704". If the year is not specified, yyyy is
returned as "????"; if the month is not specified mm is returned as
"??"; and if the day is not specified dd is returned as "??". If
the value is subsequently used in <say-as> with the
interpret-as value "vxml:date", it will be spoken as date phrase
appropriate to the current language.</td>
</tr>
<tr>
<td>digits</td>
<td>Valid spoken or DTMF inputs include one or more digits, 0
through 9. The result is a string of digits. If the result is
subsequently used in <say-as> with the interpret-as value
"vxml:digits", it will be spoken as a sequence of digits
appropriate to the current language. A user can say for example
"two one two seven", but not "twenty one hundred and twenty-seven".
A platform may support constructs such as "two double-five
eight".</td>
</tr>
<tr>
<td>currency</td>
<td>Valid spoken inputs include phrases that specify a currency
amount. For DTMF input, the "*" key will act as the decimal point.
The result is a string with the format UUUmm.nn, where UUU is the
three character currency indicator according to ISO standard 4217
[ISO4217], or mm.nn if the currency is not spoken by the user or if
the currency cannot be reliably determined (e.g. "dollar" and
"peso" are ambiguous). If the field is subsequently used in
<say-as> with the interpret-as value "vxml:currency", it will
be spoken as a currency amount appropriate to the current
language.</td>
</tr>
<tr>
<td>number</td>
<td>Valid spoken inputs include phrases that specify numbers, such
as "one hundred twenty-three", or "five point three". Valid DTMF
input includes positive numbers entered using digits and "*" to
represent a decimal point. The result is a string of digits from 0
to 9 and may optionally include a decimal point (".") and/or a plus
or minus sign. ECMAScript automatically converts result strings to
numerical values when used in numerical expressions. The result
must not use a leading zero (which would cause ECMAScript to
interpret as an octal number). If the field is subsequently used in
<say-as> with the interpret-as value "vxml:number", it will
be spoken as a number appropriate to the current language.</td>
</tr>
<tr>
<td>phone</td>
<td>Valid spoken inputs include phrases that specify a phone
number. DTMF asterisk "*" represents "x". The result is a string
containing a telephone number consisting of a string of digits and
optionally containing the character "x" to indicate a phone number
with an extension. For North America, a result could be
"8005551234x789". If the field is subsequently used in
<say-as> with the interpret-as value "vxml:phone", it will be
spoken as a phone number appropriate to the current language.</td>
</tr>
<tr>
<td>time</td>
<td>Valid spoken inputs include phrases that specify a time,
including hours and minutes. The result is a five character string
in the format hhmmx, where x is one of "a" for AM, "p" for PM, "h"
to indicate a time specified using 24 hour clock, or "?" to
indicate an ambiguous time. Input can be via DTMF. Because there is
no DTMF convention for specifying AM/PM, in the case of DTMF input,
the result will always end with "h" or "?". If the field is
subsequently used in <say-as> with the interpret-as value
"vxml:time", it will be spoken as a time appropriate to the current
language.</td>
</tr>
</tbody>
</table>
<p />
<p>Both the "boolean" and "digits" types can be parameterized as
follows:</p>
<table>
<caption>Table 50: Digit and Boolean Grammar
Parameterization</caption>
<tbody>
<tr>
<td>digits?minlength=n</td>
<td>A string of at least n digits. Applicable to speech and DTMF
grammars. If minlength conflicts with either the length or
maxlength attributes then a error.badfetch event is thrown.</td>
</tr>
<tr>
<td>digits?maxlength=n</td>
<td>A string of at most n digits. Applicable to speech and DTMF
grammars. If maxlength conflicts with either the length or
minlength attributes then a error.badfetch event is thrown.</td>
</tr>
<tr>
<td>digits?length=n</td>
<td>A string of exactly n digits. Applicable to speech and DTMF
grammars. If length conflicts with either the minlength or
maxlength attributes then a error.badfetch event is thrown.</td>
</tr>
<tr>
<td>boolean?y=d</td>
<td>A grammar that treats the keypress d as an affirmative answer.
Applicable only to the DTMF grammar.</td>
</tr>
<tr>
<td>boolean?n=d</td>
<td>A grammar that treats the keypress d as a negative answer.
Applicable only to the DTMF grammar.</td>
</tr>
</tbody>
</table>
<p>Note that more than one parameter may be specified separated by
the ";" character. This is illustrated in the last example
below.</p>
</div>
<div class="div3">
<h4><a name="d3e4794" id="d3e4794" />6.11.4 Examples</h4>
<p>A <field> element with a builtin grammar type. In this
example, the boolean type indicates that inputs are various forms
of true and false. The value actually put into the field is either
true or false. The field would be read out using the appropriate
affirmative or negative response in prompts.</p>
<div class="exampleInner">
<pre>
<field name="lo_fat_meal" type="boolean">
<prompt>
Do you want a low fat meal on this flight?
</prompt>
<help>
Low fat means less than 10 grams of fat, and under
250 calories.
</help>
<filled>
<prompt>
I heard <emphasis><say-as interpret-as="vxml:boolean">
<value expr="lo_fat_meal"/></say-as></emphasis>.
</prompt>
</filled>
</field>
</pre>
</div>
<p></p>
<p>In the next example, digits indicates that input will be spoken
or keyed digits. The result is stored as a string, and rendered as
digits using the <say-as> with "vxml:digits" as the value for
the interpret-as attribute, i.e., "one-two-three", not "one hundred
twenty-three". The <filled> action tests the field to see if
it has 12 digits. If not, the user hears the error message.</p>
<div class="exampleInner">
<pre>
<field name="ticket_num" type="digits">
<prompt>
Read the 12 digit number from your ticket.
</prompt>
<help>The 12 digit number is to the lower left.</help>
<filled>
<if cond="ticket_num.length != 12">
<prompt>
Sorry, I didn't hear exactly 12 digits.
</prompt>
<assign name="ticket_num" expr="undefined"/>
<else/>
<prompt>I heard <say-as interpret-as="vxml:digits">
<value expr="ticket_num"/></say-as>
</prompt>
</if>
</filled>
</field>
</pre>
</div>
<p></p>
<p>The builtin boolean grammar and builtin digits grammar can be
parameterized. This is done by explicitly referring to builtin
grammars using a platform-specific builtin URI scheme and using a
URI-style query syntax of the form type?param=value in the src
attribute of a <grammar> element, or in the type attribute of
a <field>. In this example, the <grammar> parameterizes
the builtin DTMF grammar, the first <field> parameterizes the
builtin DTMF grammar (the speech grammar will be activated as
normal) and the second <field> parameterizes both builtin
DTMF and speech grammars. Parameters which are undefined for a
given grammar type will be ignored; for example,
"builtin:grammar/boolean?y=7".</p>
<div class="exampleInner">
<pre>
<grammar src="builtin:dtmf/boolean?y=7;n=9"/>
<field type="boolean?y=7;n=9">
<prompt>
If this is correct say yes or press seven, if not, say no or press nine.
</prompt>
</field>
<field type="digits?minlength=3;maxlength=5">
<prompt>Please enter your passcode</prompt>
</field>
</pre>
</div>
<p></p>
</div>
</div>
<div class="div2">
<h3><a name="DAMModule" id="DAMModule" />6.12 Data Access and
Manipulation Module</h3>
<div class="div3">
<h4><a name="d1e73" id="d1e73" />6.12.1 Overview</h4>
<p>Information in the Data layer must be easily accessible and
easily editable throughout the VoiceXML 3.0 document. The Data
Access and Manipulation Module describes the necessary mechanics by
which application developers can express such interactions with the
Data layer. Implementers must augment the data access and
manipulation languages supported to provide the capabilities
described in this section.</p>
<p>The remainder of this Section covers the semantics of the Data
Access and Manipulation Module in Section 2.2 and the corresponding
syntax in Section 2.3. Backward compatibility with VoiceXML 2.1 is
discussed in Section 2.4.</p>
</div>
<div class="div3">
<h4><a name="d1e82" id="d1e82" />6.12.2 Semantics</h4>
<p>The semantics of Data Access and Manipulation can be described
in terms of the various scopes in VoiceXML 3.0, the relevance to
platform properties, the corresponding implicit variables that
platforms must support, the variable resolution mechanism, standard
session and application variables and the set of legal data values
and expressions.</p>
<div class="div4">
<h5><a name="d1e88" id="d1e88" />6.12.2.1 The scope stack</h5>
<p>Access to data is controlled by means of scopes, which are
conceptually stored in a stack. Data is always accessed within a
particular scope, which may be specified by name but defaults to
being the top scope in the stack. At initialization time, a single
scope named "session" is created. Thereafter scopes are explicitly
created and destroyed by the data model resource's clients as
necessary. Likewise, during the lifetime of each scope, data is
added, read, updated and deleted by the data model resource's
clients as necessary.</p>
<p><em>Implementation note: The API is defined in <a
href="#Resources:Datamodel:API"><b>5.1.1 Data Model Resource
API</b></a>.</em></p>
<p>At any given point in time, based on the VoiceXML document
structure and the execution state, the stack may contain the
following scopes whose semantics are described in VoiceXML 3.0 as
follows (bottom to top):</p>
<a name="variable_scope" id="variable_scope" />
<table>
<caption>Table 51: Variable Scopes</caption>
<tbody>
<tr>
<th>session</th>
<td>These are read-only variables that pertain to an entire user
session. They are declared and set by the interpreter context. New
session variables cannot be declared by VoiceXML documents.</td>
</tr>
<tr>
<th>application</th>
<td>These are declared with <var> and <script> elements
that are children of the application root document's <vxml>
element. They are initialized when the application root document is
loaded. They exist while the application root document is loaded,
and are visible to the root document and any other loaded
application leaf document. Note that while executing inside the
application root document document.x is equivalent to
application.x.</td>
</tr>
<tr>
<th>document</th>
<td>These variables are declared with <var> and
<script> elements that are children of the document's
<vxml> element. They are initialized when the document is
loaded. They exist while the document is loaded. They are visible
only within that document, unless the document is an application
root, in which case the variables are visible by leaf documents
through the application scope only.</td>
</tr>
<tr>
<th>dialog</th>
<td>Each dialog (<form> or <menu>) has a dialog scope
that exists while the user is visiting that dialog, and which is
visible to the elements of that dialog. Dialog scope contains the
following variables: variables declared by <var> and
<script> child elements of <form>, form item variables,
and form item shadow variables. The child <var> and
<script> elements of <form> are initialized when the
form is first visited, as opposed to <var> elements inside
executable content which are initialized when the executable
content is executed.</td>
</tr>
<tr>
<th><em>(anonymous)</em> </th>
<td>Each <block>, <filled>, and <catch> element
defines a new anonymous scope to contain variables declared in that
element.</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d1e162" id="d1e162" />6.12.2.2 Relevance of scope
stack to properties</h5>
<p>Properties are discussed in detail in <a
href="#Properties"><b>8.2 Properties</b></a>. Properties may be
defined for the whole application, for the whole document at the
<vxml> level, for a particular dialog at the <form> or
<menu> level, or for a particular form item. Thus, access to
properties is also controlled by means of the same scope stack that
is used by named variables.</p>
<p>VoiceXML 3.0 provides a consistent mechanism to unambiguously
read these properties in any scope using the data access and
manipulation language in a manner similar to accessing and
manipulating named variables. This is described in the two sections
below.</p>
</div>
<div class="div4">
<h5><a name="d1e174" id="d1e174" />6.12.2.3 Implicit variables</h5>
<p>VoiceXML 3.0 provides several implicit variables in the data
access and manipulation language to unambiguously identify the
various scopes in the scope stack. Whenever the corresponding
scopes are available, they can be referenced under specific names,
which are always the same regardless of the location in the
VoiceXML document. Additionally, an implicit variable "properties$"
is available in each scope which points to the defined properties
for that scope.</p>
<a name="implicit_variables" id="implicit_variables" />
<table>
<caption>Table 52: Implicit Variables</caption>
<tbody>
<tr>
<th>session</th>
<td>This implicit variable refers to the session scope.</td>
</tr>
<tr>
<th>application</th>
<td>This implicit variable refers to the application scope.</td>
</tr>
<tr>
<th>document</th>
<td>This implicit variable refers to the document scope.</td>
</tr>
<tr>
<th>dialog</th>
<td>This implicit variable refers to the dialog scope.</td>
</tr>
<tr>
<th>properties$</th>
<td>This read-only implicit variable refers to the defined
properties which affect platform behavior in a given scope. The
value is an ECMAScript object with multiple ECMAScript properties
as necessary where each ECMAScript property has the name of an
existing platform property in that scope and value corresponding to
the value of the platform property.</td>
</tr>
</tbody>
</table>
<p>Note that in some data access expression languages (such as
XPath), it may be necessary to expose the semantics of implicit
variables as expression language functions instead of
variables.</p>
<p>Also note that there is no implicit variable corresponding to
the anonymous scope since it is not necessary given the variable
resolution mechanism described in the next section. Where scope
qualifiers are functions, a function to identify the anonymous
scope may be necessary.</p>
<p>Finally, the use of the "properties$" implicit variable in
VoiceXML 3.0 means that the variable "properties$" is now reserved
in all scopes with the semantics described above.</p>
</div>
<div class="div4">
<h5><a name="d1e246" id="d1e246" />6.12.2.4 Variable
resolution</h5>
<p>This section describes how named variables are resolved in
VoiceXML 3.0. Named variables in expressions may be scope-qualified
(using implicit variables) or scope-unqualified.</p>
<p>Some examples of scope-qualified variables that may occur in
expressions are listed in the table below.</p>
<a name="resolution_examples_ecmascript"
id="resolution_examples_ecmascript" />
<table>
<caption>Table 53: Resolution examples (ECMAScript)</caption>
<thead>
<tr>
<td>Expression</td>
<td>Result</td>
</tr>
</thead>
<tbody>
<tr>
<td><em>application.hello</em></td>
<td>The value of the "hello" named variable in the application
scope.</td>
</tr>
<tr>
<td><em>dialog.retries</em></td>
<td>The value of the "retries" named variable in the dialog
scope.</td>
</tr>
<tr>
<td><em>dialog.properties$.bargein</em></td>
<td>The value of the "bargein" platform property defined at the
current "dialog" scope.</td>
</tr>
</tbody>
</table>
<p>The above table assumes that all the named variables used in the
expressions exist. If any of the named variables do not exist, an
<em>error.semantic</em> will result.</p>
<p>In cases where the named variables are unqualified i.e. there is
no implicit variable indicating the scope in use, the following
variable resolution mechanism is used:</p>
<ul>
<li>The anonymous scope is checked for the named variable, and its
value is returned if the variable is found</li>
<li>Otherwise, the dialog scope is checked for the named variable,
and its value is returned if the variable is found</li>
<li>Otherwise, the document scope is checked for the named
variable, and its value is returned if the variable is found</li>
<li>Otherwise, the application scope is checked for the named
variable, and its value is returned if the variable is found</li>
<li>Otherwise, the session scope is checked for the named variable,
and its value is returned if the variable is found</li>
<li>Otherwise, an <em>error.semantic</em> is thrown</li>
</ul>
<p>The steps corresponding to any scopes that do not exist at the
time of expression evaluation are ignored. The resolution mechanism
begins with the closest enclosing scope in the given document
structure.</p>
</div>
<div class="div4">
<h5><a name="d1e344" id="d1e344" />6.12.2.5 Standard session
variables</h5>
<p>The following standard variables are available in the session
scope:</p>
<dl>
<dt class="label"><var>session.connection.local.uri</var></dt>
<dd>This variable is a URI which addresses the local interpreter
context device.</dd>
<dt class="label"><var>session.connection.remote.uri</var></dt>
<dd>This variable is a URI which addresses the remote caller
device.</dd>
<dt class="label"><var>session.connection.protocol.name</var></dt>
<dd>This variable is the name of the connection protocol. The name
also represents the subobject name for protocol specific
information. For instance, if session.connection.protocol.name is
'q931', session.connection.protocol.q931.uui might specify the
user-to-user information property of the connection.</dd>
<dt class="label">
<var>session.connection.protocol.version</var></dt>
<dd>This variable is the version of the connection protocol.</dd>
<dt class="label"><var>session.connection.redirect</var></dt>
<dd>This variable is an array representing the connection
redirection paths. The first element is the original called number,
the last element is the last redirected number. Each element of the
array contains a uri, pi (presentation information), si (screening
information), and reason property. The reason property can be
either "unknown", "user busy", "no reply", "deflection during
alerting", "deflection immediate response", "mobile subscriber not
reachable".</dd>
<dt class="label"><var>session.connection.aai</var></dt>
<dd>This variable is application-to-application information passed
during connection setup.</dd>
<dt class="label"><var>session.connection.originator</var></dt>
<dd>This variable directly references either the local or remote
property (For instance, the following ECMAScript would return true
if the remote party initiated the connection: var caller_initiate =
connection.originator == connection.remote).</dd>
</dl>
</div>
<div class="div4">
<h5><a name="d1e402" id="d1e402" />6.12.2.6 Standard application
variables</h5>
<p>The following standard variables are available in the
application scope:</p>
<dl>
<dt class="label"><var>application.lastresult$</var></dt>
<dd>This variable holds information about the last recognition to
occur within this application. It is an array of elements where
each element, application.lastresult$[i], represents a possible
result through the following variables:
<dl>
<dt class="label">
<var>application.lastresult$.confidence</var></dt>
<dd>The whole utterance confidence level for this interpretation
from 0.0-1.0. A value of 0.0 indicates minimum confidence, and a
value of 1.0 indicates maximum confidence. More specific
interpretation of a confidence value is platform-dependent.</dd>
<dt class="label"><var>application.lastresult$.utterance</var></dt>
<dd>The raw string of words that were recognized for this
interpretation. The exact tokenization and spelling is
platform-specific (e.g. "five hundred thirty" or "5 hundred 30" or
even "530"). In the case of a DTMF grammar, this variable will
contain the matched digit string.</dd>
<dt class="label"><var>application.lastresult$.inputmode</var></dt>
<dd>For this interpretation,the mode in which user input was
provided: dtmf or voice.</dd>
<dt class="label">
<var>application.lastresult$.interpretation</var></dt>
<dd>An ECMAScript variable containing the interpretation as
described in the Semantic Interpretation for Speech Recognition
specification [SISR].</dd>
<dt class="label"><var>application.lastresult$.markname</var></dt>
<dd>The name of the mark last executed by the SSML processor before
barge-in occurred or the end of audio playback occurred. If no mark
was executed, this variable is undefined.</dd>
<dt class="label"><var>application.lastresult$.marktime</var></dt>
<dd>The number of milliseconds that elapsed since the last mark was
executed by the SSML processor until barge-in occurred or the end
of audio playback occurred. If no mark was executed, this variable
is undefined.</dd>
<dt class="label"><var>application.lastresult$.recording</var></dt>
<dd>The variable that stores a reference to the recording, or
undefined if no audio is collected. Like the input item variable
associated with a <record> element as described in section
2.3.6 of [VXML2], the implementation of this variable may vary
between platforms.</dd>
<dt class="label">
<var>application.lastresult$.recordingsize</var></dt>
<dd>The size of the recording in bytes, or undefined if no audio is
collected.</dd>
<dt class="label">
<var>application.lastresult$.recordingduration</var></dt>
<dd>The duration of the recording in milliseconds, or undefined if
no audio is collected.</dd>
</dl>
</dd>
</dl>
<p>Interpretations are sorted by confidence score, from highest to
lowest. Interpretations with the same confidence score are further
sorted according to the precedence relationship among the grammars
producing the interpretations. Different elements in
application.lastresult$ will always differ in their utterance,
interpretation, or both.</p>
<p>The number of application.lastresult$ elements is guaranteed to
be greater than or equal to one and less than or equal to the
system property "maxnbest". If no results have been generated by
the system, then "application.lastresult$" shall be ECMAScript
undefined.</p>
<p>Additionally, application.lastresult$ itself contains the
properties confidence, utterance, inputmode, and interpretation
corresponding to those of the 0th element in the ECMAScript
array.</p>
<p>All of the shadow variables described above are set immediately
after any recognition. In this context, a <nomatch> event
counts as a recognition, and causes the value of
"application.lastresult$" to be set, though the values stored in
application.lastresult$ are platform dependent. In addition, the
existing values of field variables are not affected by a
<nomatch>. In contrast, a <noinput> event does not
change the value of "application.lastresult$". After the value of
"application.lastresult$" is set, the value persists (unless it is
modified by the application) until the browser enters the next
waiting state, when it is set to <em>undefined.</em> Similarly,
when an application root document is loaded, this variable is set
to the value <em>undefined</em>. The variable
application.lastresult$ and all of its components are writable and
can be modified by the application.</p>
</div>
<div class="div4">
<h5><a name="d1e505" id="d1e505" />6.12.2.7 Legal variable values
and expressions</h5>
<p>Any data language available on a VoiceXML 3.0 platform must
specify the structure of the underlying data model. For example,
with XPath, the variable values (and hence, the constituents of the
data model) are XML trees. Such a specification of the data model
implicitly defines a set of "legal variable values", namely the
objects that can be part of such a data model.</p>
<p>Similarly, any data access and manipulation language available
on a VoiceXML 3.0 platform must specify the complete set of valid
value expressions via the expression language syntax.</p>
</div>
</div>
<div class="div3">
<h4><a name="d1e514" id="d1e514" />6.12.3 Syntax</h4>
<p>The syntax of the Data Access and Manipulation Module is
described in terms of full support for CRUD operations (Create,
Read, Update, Delete) on the Data layer in sections 2.3.1 through
2.3.4. The relevance of this syntax for properties is described in
section 2.3.5.</p>
<div class="div4">
<h5><a name="d1e520" id="d1e520" />6.12.3.1 Creating variables: the
<var> element</h5>
<p>The declaration of named variables is done using the <var>
element. It can occur in executable content or as a child of
<form> or <vxml>.</p>
<p>If it occurs in executable content, it declares a variable in
the anonymous scope associated with the enclosing <block>,
<filled>, or catch element. This declaration is made only
when the <var> element is executed. If the variable is
already declared in this scope, subsequent declarations act as
assignments, as in ECMAScript.</p>
<p>If a <var> is a child of a <form> element, it
declares a variable in the dialog scope of the <form>. This
declaration is made during the form's initialization phase.</p>
<p>If a <var> is a child of a <vxml> element, it
declares a variable in the document scope; and if it is the child
of a <vxml> element in a root document then it also declares
the variable in the application scope. This declaration is made
when the document is initialized; initializations happen in
document order.</p>
<p><em>Attributes of <var></em></p>
<a name="var_attributes" id="var_attributes" />
<table>
<caption>Table 54: <var> Attributes</caption>
<tbody>
<tr>
<th>name</th>
<td>The name of the variable that will hold the result. This
attribute must not specify a scope-qualified variable (if a
variable is specified with a scope prefix, then an error.semantic
event is thrown). The default scope in which the variable is
defined is determined from the position in the document at which
the element is declared.</td>
</tr>
<tr>
<th>expr</th>
<td>The initial value of the variable (optional). If there is no
expr attribute, the variable retains its current value, if any.
Variables start out with the default value determined by the data
access expression language in use if they are not given initial
values (for example, with ECMAScript the initial value is
<em>undefined</em>).</td>
</tr>
<tr>
<th>scope</th>
<td>The scope within which the named variable must be created
(optional). Must be one of <em>session</em>, <em>application</em>,
<em>document</em> or <em>dialog</em>. If the specified scope does
not exist, then an <em>error.semantic</em> event is thrown.</td>
</tr>
</tbody>
</table>
<p>The addition of the "scope" attribute in VoiceXML 3.0 adds more
flexibility for the creation of variables, and allows creation to
be decoupled from document location of the <var> element, if
desired by the application.</p>
<p><em>Children of <var></em></p>
<p>The children of the <var> element represent an in-line
specification of the value of the variable.</p>
<p>If "expr" attribute is present, then the element must not have
any children. Thus "expr" and children are mutually exclusive for
the <var> element.</p>
<p><em><var> examples</em></p>
<p><em>This section is informative.</em></p>
<div class="exampleInner">
<pre>
<var name="phone" expr="'6305551212'"/>
<var name="y" expr="document.z+1"/>
<var name="foo" scope="application" expr="dialog.bar * 2"/>
<var name="itinerary">
<root xmlns="">
<flight>SW123</flight>
<origin>JFK</origin>
<depart>2009-01-01T14:32:00</depart>
<destination>SFO</destination>
<arrive>2009-01-01T18:14:00</arrive>
</root>
</var>
</pre>
</div>
<p>The above examples have the following result, in order:</p>
<ol class="enumar">
<li>Creates a variable with name "phone" and String value
"6305551212" in the closest enclosing scope as determined by the
position of this <var> element in the document. If a variable
named "phone" is already present in the mentioned scope, its value
is updated to the String value "6305551212" (since this is always
true, the rest of this section will not repeat this for each
example).</li>
<li>Creates a variable with name "y" in the closest enclosing scope
as determined by the position of this <var> element in the
document and value corresponding to the result of the expression
"document.z+1", evaluated when this <var> element is
executed.</li>
<li>Creates a variable with name "foo" in the application scope and
value corresponding to the result of the expression "dialog.bar *
2", evaluated when this <var> element is executed.</li>
<li>Creates a variable with name "itinerary" in the closest
enclosing scope as determined by the position of this <var>
element in the document and value specified by the following
in-line XML tree (the internal representation may be the
corresponding DOM node, for example):
<div class="exampleInner">
<pre>
<root xmlns="">
<flight>SW123</flight>
<origin>JFK</origin>
<depart>2009-01-01T14:32:00</depart>
<destination>SFO</destination>
<arrive>2009-01-01T18:14:00</arrive>
</root>
</pre>
</div>
</li>
</ol>
<p><em>Translating to the Data Model Resource API</em></p>
<p><em>Implementation Notes: This section illustrates how the above
examples translate to the <a
href="#Resources:Datamodel:API"><b>5.1.1 Data Model Resource
API</b></a>.</em></p>
<p>The above examples result in the following Data Model Resource
API calls, in order:</p>
<ol class="enumar">
<li>At the time of <var> execution, first the value is
obtained for the new variable with name "phone" by evaluating the
expression "'6305551212'", and subsequently the variable is created
in the scope on top of the stack:
<ol class="enumla">
<li>Obtain variable value by calling
<em>EvaluateExpression("'6305551212'")</em></li>
<li>Create variable by calling <em>CreateVariable("name",
value)</em> where <em>value</em> is the result obtained in a.
above. The optional scope parameter is not specified since the
scope on the top of the stack is chosen by default.</li>
</ol>
</li>
<li>At the time of <var> execution, first the value is
obtained for the new variable with name "y" by evaluating the
expression "document.z+1", and subsequently the variable is created
in the scope on top of the stack:
<ol class="enumla">
<li>Obtain variable value by calling
<em>EvaluateExpression("document.z+1")</em></li>
<li>Create variable by calling <em>CreateVariable("y", value)</em>
where <em>value</em> is the result obtained in a. above.</li>
</ol>
</li>
<li>At the time of <var> execution, first the value is
obtained for the new variable with name "foo" by evaluating the
expression "dialog.bar * 2", and subsequently the variable is
created in application scope:
<ol class="enumla">
<li>Obtain variable value by calling
<em>EvaluateExpression("dialog.bar * 2")</em></li>
<li>Create variable by calling <em>CreateVariable("foo", value,
"application")</em> where <em>value</em> is the result obtained in
a. above.</li>
</ol>
</li>
<li>At the time of <var> execution, the new variable with
name "itinerary" is created in the scope on top of the stack using
the in-line specification for the value in the body of the
<var> element:
<ol class="enumla">
<li>Process the in-line specification below into an internal
representation for the data model. For example, the assumed XML
data model in this example may choose to internally represent this
in-line specification as a DOM node.
<div class="exampleInner">
<pre>
<root xmlns="">
<flight>SW123</flight>
<origin>JFK</origin>
<depart>2009-01-01T14:32:00</depart>
<destination>SFO</destination>
<arrive>2009-01-01T18:14:00</arrive>
</root>
</pre>
</div>
</li>
<li>Create variable by calling <em>CreateVariable("itinerary",
node)</em> where <em>node</em> is the DOM node from a. above.</li>
</ol>
</li>
</ol>
</div>
<div class="div4">
<h5><a name="d1e742" id="d1e742" />6.12.3.2 Reading variables:
"expr" and "cond" attributes and the <value> element</h5>
<p>The values of the named variables in the existing scopes in the
scope stack are available for introspection and for further
computation. These values can be read wherever expressions can be
specified in the VoiceXML 3.0 document. Important examples include
the "expr" and "cond" attributes on various syntactic elements. The
"expr" attribute values are legal expressions as defined by the
syntax of the data access and manipulation language (see Section
2.2.7 for details). The "cond" attribute values function as
predicates, and in addition to being expressions, must evaluate to
a <em>boolean</em> value.</p>
<div class="div5">
<h6><a name="d1e751" id="d1e751" />6.12.3.2.1 Inserting variable
values in prompts: The <value> element</h6>
<p>The <value> element is used to insert the value of an
expression into a prompt. <a href="#PromptModule"><b>6.4 Prompt
Module</b></a> specifies prompts in detail.</p>
<p><em>Attributes of <value></em></p>
<a name="value_attributes" id="value_attributes" />
<table>
<caption>Table 55: <value> attributes</caption>
<tbody>
<tr>
<th>expr</th>
<td>The expression to render. See Section 2.2.7 for legal values of
expressions.</td>
</tr>
<tr>
<th>scope</th>
<td>The scope within which the named variables in the expression
are resolved (optional). Must be one of <em>session</em>,
<em>application</em>, <em>document</em> or <em>dialog</em>. If the
specified scope does not exist, then an <em>error.semantic</em>
event is thrown.</td>
</tr>
</tbody>
</table>
<p><em><value> examples</em></p>
<div class="exampleInner">
<pre>
<value expr="application.duration + dialog.duration"/>
<value expr="foo * bar"/>
<value expr="foo + bar + application.baz" scope="document"/>
</pre>
</div>
<p>The above examples render the following, in order:</p>
<ol class="enumar">
<li>The value corresponding to the sum (or concatenation, as the
case may be) of the "duration" named variable in the application
scope and the "duration" named variable in the dialog scope.</li>
<li>The value corresponding to the product of the "foo" and "bar"
named variables in the closest enclosing scope (the top of the
scope stack).</li>
<li>The value corresponding to the sum (or concatenation, as the
case may be) of the "foo" and "bar" named variables in the document
scope, and the "baz" named variable in the application scope.</li>
</ol>
<p><em>Translating to the Data Model Resource API</em></p>
<p><em>Implementation Notes: This section illustrates how the above
examples translate to the <a
href="#Resources:Datamodel:API"><b>5.1.1 Data Model Resource
API</b></a>.</em></p>
<p>The above examples result in the following Data Model Resource
API calls:</p>
<ol class="enumar">
<li>
<ol class="enumla">
<li>Evaluate the expression "application.duration +
dialog.duration" in the closest enclosing scope by calling
<em>EvaluateExpression("application.duration +
dialog.duration")</em></li>
<li>The expression evaluator in turn resolves the scope-qualified
variables in the expression by calling <em>ReadVariable("duration",
"application")</em> <em>ReadVariable("duration",
"dialog")</em></li>
</ol>
</li>
<li>
<ol class="enumla">
<li>Evaluate the expression "foo * bar" in the closest enclosing
scope by calling <em>EvaluateExpression("foo * bar")</em></li>
<li>The expression evaluator in turn resolves the scope-unqualified
variables in the expression by calling <em>ReadVariable("foo")</em>
<em>ReadVariable("bar")</em></li>
</ol>
</li>
<li>
<ol class="enumla">
<li>Evaluate the expression "foo + bar + application.baz" in the
document scope in the expression by calling
<em>EvaluateExpression("foo + bar + application.baz",
"document")</em></li>
<li>The expression evaluator in turn resolves the variables by
calling <em>ReadVariable("foo", "document")</em>
<em>ReadVariable("bar", "document")</em> <em>ReadVariable("baz",
"application")</em></li>
</ol>
</li>
</ol>
</div>
</div>
<div class="div4">
<h5><a name="d1e907" id="d1e907" />6.12.3.3 Updating variables: the
<assign> and <data> elements</h5>
<div class="div5">
<h6><a name="d1e910" id="d1e910" />6.12.3.3.1 The <assign>
element</h6>
<p>The <assign> element assigns a value to a variable.</p>
<p>It is illegal to make an assignment to a variable that has not
been explicitly declared using a <var> element or a var
statement within a <script>. Attempting to assign to an
undeclared variable causes an <em>error.semantic</em> event to be
thrown.</p>
<p>Note that when an ECMAScript object, say "obj", has been
properly initialized then its properties, for instance "obj.prop1",
can be assigned without explicit declaration (in fact, an attempt
to declare ECMAScript object properties such as "obj.prop1" would
result in an <em>error.semantic</em> event being thrown).</p>
<p><em>Attributes of <assign></em></p>
<a name="assign_attributes" id="assign_attributes" />
<table>
<caption>Table 56: <assign> attributes</caption>
<tbody>
<tr>
<th>name</th>
<td>The name of the variable being assigned to. The corresponding
variable must have been previously declared otherwise an
<em>error.semantic</em> event is thrown. By default, the scope in
which the variable is resolved is the closest enclosing scope of
the currently active element. To remove ambiguity, the variable
name may be prefixed with a scope name.</td>
</tr>
<tr>
<th>expr</th>
<td>The expression evaluating to the new value of the variable
(optional).</td>
</tr>
</tbody>
</table>
<p><em>Children of <assign></em></p>
<p>The children of the <assign> element represent an in-line
specification of the new value of the variable.</p>
<p>If "expr" attribute is present, then the element must not have
any children. Thus "expr" and children are mutually exclusive for
the <assign> element.</p>
<p><em><assign> examples</em></p>
<p><em>This section is informative.</em></p>
<div class="exampleInner">
<pre>
<assign name="phone" expr="'6305551212'"/>
<assign name="y" expr="document.z+1"/>
<assign name="application.foo" expr="dialog.bar * 2"/>
<assign name="itinerary">
<root xmlns="">
<flight>SW123</flight>
<origin>JFK</origin>
<depart>2009-01-01T14:32:00</depart>
<destination>SFO</destination>
<arrive>2009-01-01T18:14:00</arrive>
</root>
</var>
</pre>
</div>
<p>The above examples have the following result, in order:</p>
<ol class="enumar">
<li>Updates the variable with name "phone" to a new String value
"6305551212" in the closest enclosing scope as determined by the
position of this <assign> element in the document. If a
variable named "phone" is not already defined in the mentioned
scope, an <em>error.semantic</em> is thrown (since this is always
true if variables that are not already defined are attempted to be
updated using <assign>, the rest of this section will not
repeat this for each example).</li>
<li>Updates the variable with name "y" in the closest enclosing
scope as determined by the position of this <assign> element
in the document to the value corresponding to the result of the
expression "document.z+1", evaluated when this <assign>
element is executed.</li>
<li>Updates the variable with name "foo" in the application scope
to the value corresponding to the result of the expression
"dialog.bar * 2", evaluated when this <assign> element is
executed.</li>
<li>Updates the variable with name "itinerary" in the closest
enclosing scope as determined by the position of this
<assign> element in the document to the value specified by
the following in-line XML tree (the internal representation may be
the corresponding DOM node, for example):
<div class="exampleInner">
<pre>
<root xmlns="">
<flight>SW123</flight>
<origin>JFK</origin>
<depart>2009-01-01T14:32:00</depart>
<destination>SFO</destination>
<arrive>2009-01-01T18:14:00</arrive>
</root>
</pre>
</div>
</li>
</ol>
<p><em>Translating to the Data Model Resource API</em></p>
<p><em>Implementation Notes: This section illustrates how the above
examples translate to the <a
href="#Resources:Datamodel:API"><b>5.1.1 Data Model Resource
API</b></a>.</em></p>
<p>The above examples result in the following Data Model Resource
API calls, in order:</p>
<ol class="enumar">
<li>At the time of <assign> execution, first the new value is
obtained for the variable with name "phone" by evaluating the
expression "'6305551212'", and subsequently the variable is updated
in the scope on top of the stack:
<ol class="enumla">
<li>Obtain new variable value by calling
<em>EvaluateExpression("'6305551212'")</em></li>
<li>Update variable value by calling <em>UpdateVariable("name",
value)</em> where <em>value</em> is the result obtained in a.
above. The optional scope parameter is not specified since the
scope on the top of the stack is chosen by default.</li>
</ol>
</li>
<li>At the time of <assign> execution, first the new value is
obtained for the variable with name "y" by evaluating the
expression "document.z+1", and subsequently the variable is updated
in the scope on top of the stack:
<ol class="enumla">
<li>Obtain new variable value by calling
<em>EvaluateExpression("document.z+1")</em></li>
<li>Update variable value by calling <em>UpdateVariable("y",
value)</em> where <em>value</em> is the result obtained in a.
above.</li>
</ol>
</li>
<li>At the time of <assign> execution, first the new value is
obtained for the variable with name "foo" by evaluating the
expression "dialog.bar * 2", and subsequently the variable is
updated in application scope:
<ol class="enumla">
<li>Obtain new variable value by calling
<em>EvaluateExpression("dialog.bar * 2")</em></li>
<li>Update variable value by calling <em>UpdateVariable("foo",
value, "application")</em> where <em>value</em> is the result
obtained in a. above.</li>
</ol>
</li>
<li>At the time of <assign> execution, the variable with name
"itinerary" is updated in the scope on top of the stack using the
in-line specification for the new value specified in the body of
the <assign> element:
<ol class="enumla">
<li>Process the in-line specification below into an internal
representation for the data model. For example, the assumed XML
data model in this example may choose to internally represent this
in-line specification as a DOM node.
<div class="exampleInner">
<pre>
<root xmlns="">
<flight>SW123</flight>
<origin>JFK</origin>
<depart>2009-01-01T14:32:00</depart>
<destination>SFO</destination>
<arrive>2009-01-01T18:14:00</arrive>
</root>
</pre>
</div>
</li>
<li>Update variable value by calling
<em>UpdateVariable("itinerary", node)</em> where <em>node</em> is
the DOM node from a. above.</li>
</ol>
</li>
</ol>
</div>
<div class="div5">
<h6><a name="d1e1108" id="d1e1108" />6.12.3.3.2 The <data>
element</h6>
<p>The <data> element allows a VoiceXML application to fetch
an in-line specification of a new value for a named variable from a
document server without transitioning to a new VoiceXML document.
The data fetched is bound to the named variable.</p>
<p><em>Attributes of <data></em></p>
<p>The <data> element has the attributes specified in Table
57, in addition to the fetchtimeout, fetchhint, maxage, and
maxstale attributes as specified in <a href="#Fetching"><b>8.1.1
Fetching</b></a>.</p>
<a name="data_attributes" id="data_attributes" />
<table>
<caption>Table 57: <data> Attributes</caption>
<tbody>
<tr>
<th>src</th>
<td>The URI specifying the location of the in-line data
specification to retrieve (optional). This specification depends on
the data language in use for the VoiceXML document (XML,
JSON).</td>
</tr>
<tr>
<th>name</th>
<td>The name of the variable that the data fetched will be bound
to.</td>
</tr>
<tr>
<th>scope</th>
<td>The scope within which the named variable to bind the data is
found (optional). Must be one of <em>session</em>,
<em>application</em>, <em>document</em> or <em>dialog</em>. If the
specified scope does not exist, then an <em>error.semantic</em>
event is thrown.</td>
</tr>
<tr>
<th>srcexpr</th>
<td>Like src, except that the URI is dynamically determined by
evaluating the given expression when the data needs to be fetched
(optional). If srcexpr cannot be evaluated, an
<em>error.semantic</em> event is thrown.</td>
</tr>
<tr>
<th>method</th>
<td>The request method: get (the default) or post (optional).</td>
</tr>
<tr>
<th>namelist</th>
<td>The list of variables to submit (optional). By default, no
variables are submitted. If a namelist is supplied, it may contain
individual variable references which are submitted with the same
qualification used in the namelist. Declared VoiceXML variables can
be referenced.</td>
</tr>
<tr>
<th>enctype</th>
<td>The media encoding type of the submitted document (optional).
The default is application/x-www-form-urlencoded. Interpreters must
also support multipart/form-data [RFC2388] and may support
additional encoding types.</td>
</tr>
<tr>
<th>fetchaudio</th>
<td>See <a
href="http://www.w3.org/TR/2004/REC-voicexml20-20040316/#dml6.1">Section
6.1</a> of [VXML2] (optional). This defaults to the fetchaudio
property described in <a
href="http://www.w3.org/TR/2004/REC-voicexml20-20040316/#dml6.3.5">Section
6.3.5</a> of [VXML2].</td>
</tr>
</tbody>
</table>
<p>Exactly one of "src" or "srcexpr" must be specified; otherwise,
an error.badfetch event is thrown. If the content cannot be
retrieved, the interpreter throws an error as specified for fetch
failures in Section 5.2.6 of [VXML2].</p>
<p>If the value of the src or srcexpr attribute includes a fragment
identifier, the processing of that fragment identifier is
platform-specific.</p>
<p>Platforms should support parsing XML data into a DOM. If an
implementation does not support DOM, the name attribute must not be
set, and any retrieved content must be ignored by the interpreter.
If the name attribute is present, these implementations will throw
error.unsupported.data.name.</p>
<p>If the name attribute is present, and the returned document is
XML as identified by [RFC3023], the VoiceXML interpreter must
expose the retrieved content via a read-only subset of the DOM as
specified in Appendix D of [VXML2.1]. An interpreter may support
additional data formats by recognizing additional media types. If
an interpreter receives a document in a data format that it does
not understand, or the data is not well-formed as defined by the
specification of that format, the interpreter throws
error.badfetch. If the media type of the retrieved content is one
of those defined in [RFC3023] but the content is not well-formed
XML, the interpreter throws error.badfetch.</p>
<p>If use of the DOM causes an uncaught DOMException to be thrown,
the VoiceXML interpreter throws error.semantic.</p>
<p>Before exposing the data in an XML document referenced by the
<data> element via the DOM, the interpreter should check that
the referring document is allowed to access the data. If access is
denied the interpreter must throw error.noauthorization.</p>
<p>Note: One strategy commonly implemented in voice browsers to
control access to data is the "access-control" processing
instruction described in the WG Note: <em>Authorizing Read Access
to XML Content Using the <?access-control?> Processing
Instruction 1.0</em> [DATA_AUTH].</p>
<p>Like the <var> element, the <data> element can occur
in executable content or as a child of <form> or
<vxml>. In addition, it shares the same default scoping rules
as the <var> element. If a <data> element has the same
name as a variable already declared in the same scope, the variable
is assigned a reference to the new value exposed by the
<data> element.</p>
<p>Like the <submit> element, when variable data is submitted
to the server its value is first converted into a string before
being submitted. If the variable is a DOM Object, its serialized as
the corresponding XML. If the variable is an ECMAScript Object, the
mechanism by which it is submitted is not currently defined. If a
<data> element's namelist contains a variable which
references recorded audio but does not contain an enctype of
multipart/form-data [RFC2388], the behavior is not specified. It is
discouraged to attempt to URL-encode large quantities of data.</p>
<p><em><data> example</em></p>
<p>The example discussed in this section uses XML as the data
language and fetches the following XML document using the
<data> element:</p>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<quote xmlns="http://www.example.org">
<ticker>F</ticker>
<name>Ford Motor Company</name>
<change>0.10</change>
<last>3.00</last>
</quote>
</pre>
</div>
<p>The above stock quote is retrieved in one dialog, the document
element is cached in a variable at document scope and used to
playback the quote in another dialog. The data access and
manipulation language in the example is XPath 2.0 [XPATH20].</p>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml"
version="2.1"
xmlns:ex="http://www.example.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml
http://www.w3.org/TR/2007/REC-voicexml21-20070619/vxml.xsd">
<var name="quote"/>
<var name="tickers">
<tickers xmlns="">
<ford>f</ford>
<!-- etc., the dialog below hardcodes ford -->
</tickers>
</var>
<form id="get_quote">
<block>
<data name="quote" scope="document"
srcexpr="'http://www.example.org/getquote?ticker=' + document('tickers')/ford"/>
<goto next="#play_quote"/>
</block>
</form>
<form id="play_quote">
<block>
<var name="name" expr="document('quote')/ex:name"/>
<var name="change" expr="document('quote')/ex:change"/>
<var name="last" expr="document('quote')/ex:last"/>
<var name="dollars" expr="fn:floor(last)"/>
<var name="cents" expr="fn:substring(last,fn:string-length(last)-1)"/>
<!--play the company name -->
<audio expr="document('tickers')/ford + '.wav'"><value expr="name"/></audio>
<!-- play 'unchanged, 'up', or 'down' based on zero, positive, or negative change -->
<if cond="change = 0">
<audio src="unchanged_at.wav"/>
<else/>
<if cond="change &gt; 0">
<audio src="up.wav"/>
<else/> <!-- negative -->
<audio src="down.wav"/>
</if>
<audio src="by.wav"/>
<!-- play change in value as positive number -->
<audio expr="fn:abs(change) + '.wav'"><value expr="fn:abs(change)"/></audio>
<audio src="to.wav"/>
</if>
<!-- play the current price per share -->
<audio expr="dollars + '.wav'"><value expr="dollars"/></audio>
<if cond="cents &gt; 0">
<audio src="point.wav"/>
<audio expr="cents + '.wav'"><value expr="cents"/></audio>
</if>
</block>
</form>
</vxml>
</pre>
</div>
<p><em>Translating to the Data Model Resource API</em></p>
<p><em>Implementation Notes: This section illustrates how the above
examples translate to the <a
href="#Resources:Datamodel:API"><b>5.1.1 Data Model Resource
API</b></a>.</em></p>
<p>The single <data> usage in the above example results in
the following behavior and Data Model Resource API calls:</p>
<p>At the time of <data> execution, the variable with name
"quote" is updated in the document scope using the in-line
specification for the new value retrieved from the URI expression
<em>'http://www.example.org/getquote?ticker=' +
document('tickers')/ford</em> which evaluates to
<em>http://www.example.org/getquote?ticker=f</em></p>
<ol class="enumar">
<li>Obtain the URI to request the in-line specification of the new
value from, by evaluating the "srcexpr" attribute value
<em>EvaluateExpression("'http://www.example.org/getquote?ticker=' +
document('tickers')/ford")</em></li>
<li>Request the in-line specification from the URI resulting from
a. which happens to be
<em>http://www.example.org/getquote?ticker=f</em> in this
example.</li>
<li>Process the response received (the in-line data specification
below) into an internal representation for the data model. The XML
data model internally represents this in-line specification as a
DOM node (the document element).
<div class="exampleInner">
<pre>
<quote xmlns="http://www.example.org">
<ticker>F</ticker>
<name>Ford Motor Company</name>
<change>0.10</change>
<last>3.00</last>
</quote>
</pre>
</div>
</li>
<li>Update the "quote" variable value in document scope by calling
<em>UpdateVariable("quote", node, "document")</em> where
<em>node</em> is the DOM node in c. above.</li>
</ol>
<p><em><data> Fetching Properties</em></p>
<p>These properties pertain to documents fetched by the
<data> element.</p>
<a name="data_fetching_properties" id="data_fetching_properties" />
<table>
<caption>Table 58: <data> Fetching Properties</caption>
<tbody>
<tr>
<th>datafetchhint</th>
<td>Tells the platform whether or not data documents may be
pre-fetched. The value is either prefetch (the default), or
safe.</td>
</tr>
<tr>
<th>datamaxage</th>
<td>Tells the platform the maximum acceptable age, in seconds, of
cached documents. The default is platform-specific.</td>
</tr>
<tr>
<th>datamaxstale</th>
<td>Tells the platform the maximum acceptable staleness, in
seconds, of expired cached data documents. The default is
platform-specific.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="div4">
<h5><a name="d1e1456" id="d1e1456" />6.12.3.4 Deleting variables:
the <clear> element</h5>
<p>The <clear> element resets one or more variables,
including form items.</p>
<p>For each specified variable name, the variable is resolved
relative to the current scope by default (to remove ambiguity, each
variable name in the namelist may be prefixed with a scope name).
Once a declared variable has been identified, its value is assigned
the default initial value defined by the data access expression
language in use (for example, when using ECMAScript, the variables
are reset to the <em>undefined</em> value). In addition, if the
variable name corresponds to a form item, then the form item's
prompt counter and event counter are reset.</p>
<p><em>Attributes of <clear></em></p>
<a name="clear_attributes" id="clear_attributes" />
<table>
<caption>Table 59: <clear> attributes</caption>
<tbody>
<tr>
<th>namelist</th>
<td>The list of variables to be reset; this can include variable
names other than form items. If an undeclared variable is
referenced in the namelist, then an <em>error.semantic</em> is
thrown. When not specified, all form items in the current form are
cleared.</td>
</tr>
<tr>
<th>scope</th>
<td>The scope within which the named variables must be resolved
(optional). Must be one of <em>session</em>, <em>application</em>,
<em>document</em> or <em>dialog</em>. If the specified scope does
not exist, then an <em>error.semantic</em> event is thrown.</td>
</tr>
</tbody>
</table>
<p><em><clear> examples</em></p>
<p><em>This section is informative.</em></p>
<p />
<div class="exampleInner">
<pre>
<clear namelist="city state zip"/>
<clear namelist="application.foo dialog.bar baz"/>
<clear namelist="alpha beta application.gamma" scope="document"/>
<clear/>
<clear scope="dialog"/>
</pre>
</div>
<p />
<p>The above examples have the following result, in order:</p>
<ol class="enumar">
<li>The variables "city", "state" and "zip" in the closest
enclosing scope are reset. If any of these are form items, the
associated prompt and event counters are also reset (since this is
always true if variables are form items, the rest of this section
will not repeat this for each example).</li>
<li>The variable "foo" is reset in application scope, the variable
"bar" is reset in the dialog scope and the variable "baz" is reset
in the closest enclosing scope.</li>
<li>The scope-unqualified "alpha" and "beta" variables are reset in
the specified document scope default, and the "gamma" variable is
reset in the application scope.</li>
<li>All variables in the closest enclosing scope are reset.</li>
<li>All variables in the dialog scope are reset.</li>
</ol>
<p><em>Translating to the Data Model Resource API</em></p>
<p><em>Implementation Notes: This section illustrates how the above
examples translate to the <a
href="#Resources:Datamodel:API"><b>5.1.1 Data Model Resource
API</b></a>.</em></p>
<p>The above examples result in the following Data Model Resource
API calls, in order:</p>
<ol class="enumar">
<li>The namelist "city state zip" is tokenized into variable names
and each variable is reset in the scope on top of the stack (the
optional scope parameter is not specified in the calls since the
scope on the top of the stack is chosen by default):
<ol class="enumla">
<li>Tokenize namelist "city state zip" into tokens "city", "state"
and "zip"</li>
<li>Reset variable "city" by calling
<em>DeleteVariable("city")</em></li>
<li>Reset variable "state" by calling
<em>DeleteVariable("state")</em></li>
<li>Reset variable "zip" by calling
<em>DeleteVariable("zip")</em></li>
</ol>
</li>
<li>The namelist "application.foo dialog.bar baz" is tokenized into
variable names and each scope-qualified variable is reset in the
mentioned scope and scope-unqualified variables are reset in the
scope on top of the stack:
<ol class="enumla">
<li>Tokenize namelist "application.foo dialog.bar baz" into tokens
"application.foo", "dialog.bar" and "baz"</li>
<li>Reset variable "foo" in application scope by calling
<em>DeleteVariable("foo", "application")</em></li>
<li>Reset variable "bar" in dialog scope by calling
<em>DeleteVariable("bar", "dialog")</em></li>
<li>Reset variable "baz" in current scope by calling
<em>DeleteVariable("baz")</em></li>
</ol>
</li>
<li>The namelist "alpha beta application.gamma" is tokenized into
variable names and each scope-qualified variable is reset in the
mentioned scope and scope-unqualified variables are reset in the
document scope:
<ol class="enumla">
<li>Tokenize namelist "alpha beta application.gamma" into tokens
"alpha", "beta" and "application.gamma"</li>
<li>Reset variable "alpha" by calling <em>DeleteVariable("alpha",
"document")</em></li>
<li>Reset variable "beta" by calling <em>DeleteVariable("beta",
"document")</em></li>
<li>Reset variable "gamma" by calling <em>DeleteVariable("gamma",
"application")</em></li>
</ol>
</li>
<li>In the absence of a namelist, each variable in the scope on top
of the stack is reset. For each variable <em>var</em> in the
closest enclosing scope:
<ol class="enumla">
<li>Reset variable <em>DeleteVariable(var)</em></li>
<li>If <em>var</em> is a form item, reset prompt and event
counters</li>
</ol>
</li>
<li>In the absence of a namelist, each variable in the dialog scope
is reset. For each variable <em>var</em> in dialog scope:
<ol class="enumla">
<li>Reset variable <em>DeleteVariable(var, "dialog")</em></li>
<li>If <em>var</em> is a form item, reset prompt and event
counters</li>
</ol>
</li>
</ol>
<div class="issue">
<p class="prefix"><a name="ResetVar" id="ResetVar" /><b>Issue
(ResetVar):</b></p>
<p class="prefix"><b>ResetVariable()?</b></p>
<p>While this section uses the DeleteVariable() method, a
ResetVariable() method that better aligns with <clear>
semantics should be considered for addition to the <a
href="#Resources:Datamodel:API"><b>5.1.1 Data Model Resource
API</b></a>. This will allow resetting variable values to the
initial in-line specification when such is present, for
instance.</p>
<p class="prefix"><b>Resolution:</b></p>
<p>None recorded.</p>
</div>
</div>
<div class="div4">
<h5><a name="d1e1703" id="d1e1703" />6.12.3.5 Relevance for
properties</h5>
<p>Platform properties are discussed in detail in <a
href="#Properties"><b>8.2 Properties</b></a>. VoiceXML 3.0 provides
a consistent mechanism to unambiguously read these properties in
any scope using the data access and manipulation language in a
manner similar to accessing and manipulating named variables as
illustrated in section 2.3.2. However, properties cannot be
created, updated or deleted using any of the syntax described in
this module. The <property> element syntax must be used for
such operations.</p>
</div>
</div>
<div class="div3">
<h4><a name="d1e1712" id="d1e1712" />6.12.4 Backward compatibility
with VoiceXML 2.1</h4>
<p>VoiceXML 3.0 adds some new features to data access and
manipulation but does not change any existing behavior. Thus, this
module is backwards compatible with Voice XML 2.1.</p>
<p>Likewise, the VoiceXML 2.1 profile in VoiceXML 3.0 is not
required to support any of the new features added in this module.
In particular, the following features may be excluded by
implementors supporting the VoiceXML 2.1 profile.</p>
<a name="voicexml21_profile_exclusions"
id="voicexml21_profile_exclusions" />
<table>
<caption>Table 60: VoiceXML 2.1 profile exclusions</caption>
<tbody>
<tr>
<th>properties$ implicit variable</th>
<td>The VoiceXML 2.1 profile does not require the properties$
implicit variable to be supported in any scopes.</td>
</tr>
<tr>
<th>"scope" attribute</th>
<td>The optional "scope" attribute is not required to be supported
in the VoiceXML 2.1 profile for the <var>, <value>,
<assign>, <data> and <clear> elements.</td>
</tr>
<tr>
<th><var> and <assign> children</th>
<td>The VoiceXML 2.1 profile does not require in-line
specifications for the initial value using the children of the
<var> element or in-line specifications for the new value
using the children of the <assign> element to be
supported.</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="d1e1757" id="d1e1757" />6.12.5 Implicit functions
using XPath</h4>
<p>Implicit variables described in section 2.2.3 to qualify scope
are amenable to certain data access and manipulation languages
(such as ECMAScript) but are not as elegant while incorporating in
the syntax of others, such as XPath. VoiceXML 3.0 permits the use
of functions rather than variables to address this. The following
table illustrates how scope qualifiers are exposed as XPath
functions.</p>
<table border="1">
<caption>Table 61: Implicit XPath functions and variables</caption>
<tbody>
<tr>
<th>session()</th>
<td>This single String argument function retrieves the value of the
variable named in the argument from the session scope.</td>
</tr>
<tr>
<th>application()</th>
<td>This single String argument function retrieves the value of the
variable named in the argument from the application scope.</td>
</tr>
<tr>
<th>document()</th>
<td>This single String argument function retrieves the value of the
variable named in the argument from the document scope.</td>
</tr>
<tr>
<th>dialog()</th>
<td>This single String argument function retrieves the value of the
variable named in the argument from the dialog scope.</td>
</tr>
<tr>
<th>anonymous()</th>
<td>This single String argument function retrieves the value of the
variable named in the argument from the anonymous scope.</td>
</tr>
<tr>
<th>properties$</th>
<td>This read-only implicit variable refers to the defined
properties which affect platform behavior in a given scope. The
value is an XML tree with a <properties> root element and
multiple children as necessary where each child element has the
name of an existing platform property in that scope and body
content corresponding to the value of the platform property. CDATA
sections are used if necessary.</td>
</tr>
</tbody>
</table>
<p>The following table shows how these qualifier functions are
used, and the examples are XPath variants of the examples
illustrated in Table 53.</p>
<table>
<caption>Table 62: Resolution examples (XPath)</caption>
<thead>
<tr>
<td>Usage</td>
<td>Result</td>
</tr>
</thead>
<tbody>
<tr>
<td><em>application('hello')</em></td>
<td>The value of the "hello" named variable in the application
scope.</td>
</tr>
<tr>
<td><em>dialog('retries')</em></td>
<td>The value of the "retries" named variable in the dialog
scope.</td>
</tr>
<tr>
<td><em>dialog('properties$')/bargein</em></td>
<td>The value of the "bargein" platform property defined at the
current "dialog" scope.</td>
</tr>
</tbody>
</table>
<div class="issue">
<p class="prefix"><a name="DataProfiles"
id="DataProfiles" /><b>Issue (DataProfiles):</b></p>
<p class="prefix"><b>Data profiles?</b></p>
<p>Consider moving contents into a profile that includes an XML
Data Model and XPath Data Access and Manipulation. Generically,
consider profiles for various data access and manipulation
languages, including an ECMA profile.</p>
<p class="prefix"><b>Resolution:</b></p>
<p>None recorded.</p>
</div>
</div>
</div>
<div class="div2">
<h3><a name="ExternalCommunicationModule"
id="ExternalCommunicationModule" />6.13 External Communication
Module</h3>
<p>This module supports the sending and receiving of external
messages by a voice application by introducing the <send> and
<receive> elements into VoiceXML. The application developer
chooses to send and receive external messages synchronously or
asynchronously. When sending a message, the developer chooses
whether or not it should represent a named event. The developer
also chooses whether or not to include a payload. These choices can
be made statically or dynamically at run-time.</p>
<p>Note that this section only covers receiving messages that the
interpreter does not handle. In other words, at application level
events. Some events, like lifecycle events targeted at creating or
destroying sessions are not targetted at the application author but
instead are handled by the browser itself. The complete list of all
these interpreter level events is TBD but might include events such
as "create session", "pause", "resume", or "disconnect".</p>
<p>Although this section handles many of the easy and moderately
difficult cases, for certain very complicated cases it may be
appropriate to put a gatekeeper filter between the VXML interpreter
and the external events to filter and only allow certain events to
interrupt the processing of the VXML document. For example if
someone wanted a "operator" event to only be allowed to interrupt
the VXML document if its data variable held a certain value, or if
they wanted the "operator" event but not the "caller" event, then a
filter might be appropriate. SCXML is one method that is suitable
for providing these type of more advanced filters.</p>
<div class="div3">
<h4><a name="ExternalCommunicationModule:Receive"
id="ExternalCommunicationModule:Receive" />6.13.1 Receiving
external messages within a voice application</h4>
<p>Because external messages can arrive at any time, they can be
disruptive to a voice application. A voice application developer
decides whether these messages are delivered to the application
synchronously or asynchronously using the "externalevents.enable"
property. The property can be set to one of the following
values:</p>
<a name="receive:externalevents.enable"
id="receive:externalevents.enable" />
<table>
<caption>Table 63: externalevents.enable values</caption>
<tbody>
<tr>
<th>true</th>
<td>External messages are delivered asynchronously as VoiceXML
events.</td>
</tr>
<tr>
<th>false</th>
<td>External messages are delivered synchronously. This is the
default.</td>
</tr>
</tbody>
</table>
<p>When external messages are delivered synchronously, an
application developer decides whether these messages are preserved
or discarded by setting the "externalevents.queue" property. The
property can be set to one of the following values:</p>
<table>
<caption>Table 64: externalevents.queue values</caption>
<tbody>
<tr>
<th>true</th>
<td>External messages are queued.</td>
</tr>
<tr>
<th>false</th>
<td>An external messages that is not delivered as a VoiceXML event
is discarded. This is the default.</td>
</tr>
</tbody>
</table>
<div class="div4">
<h5><a name="ExternalCommunicationModule:ReceiveReflect"
id="ExternalCommunicationModule:ReceiveReflect" />6.13.1.1 External
Message Reflection</h5>
<p>If "externalevents.enable" is set to true and an external
message arrives, the external message is reflected to the
application in the application.lastmessage$ variable.
application.lastmessage$ is an ECMAScript object with the following
properties:</p>
<table>
<caption>Table 65: application.lastmessage$ properties</caption>
<tbody>
<tr>
<th>contenttype</th>
<td>The media type of the external message.</td>
</tr>
<tr>
<th>event</th>
<td>The event name, if any, or ECMAScript undefined if no event
name was included in the external message.</td>
</tr>
<tr>
<th>content</th>
<td>The content of the message, if any, or ECMAScript undefined. If
the Content-Type of the message is one of the media types described
in [RFC 3023], the VoiceXML interpreter must expose the retrieved
content via a read-only subset of the DOM as described in [VXML21].
An interpreter may support additional data formats by recognizing
additional media types. If an interpreter receives an external
message with a payload in a data format that it does not
understand, or the payload is not well-formed as defined by the
specification of that format, the interpreter throws
"error.badfetch".</td>
</tr>
</tbody>
</table>
<p>If no external messages have been received,
application.lastmessage$ is ECMAScript undefined. Only the last
received message is available. To preserve a message for future
reference during the lifetime of the application, the application
developer can copy the data to an application-scoped variable.</p>
</div>
<div class="div4">
<h5><a name="ExternalCommunicationModule:ReceiveAsync"
id="ExternalCommunicationModule:ReceiveAsync" />6.13.1.2 Receiving
External Messages Asynchronously</h5>
<p>To receive an external message asynchronously, an application
defines an "externalmessage" event handler. The event handler must
be declared within the appropriate scope since the user-defined
<catch> handler is selected using the algorithm described in
section 5.2.4 of [VXML2].</p>
<p>If the payload of an external message includes an event name,
the name is appended to the name of the event that is thrown to the
application separated by a dot (e.g. "externalmessage.ready"). This
allows applications to handle external messages using different
event handlers.</p>
<p>Asynchronous external messages are processed in the same manner
that a disconnect event is handled in <a
href="http://www.w3.org/TR/2004/REC-voicexml20-20040316/">VXML2</a>.</p>
<p>Events are dispatched to the application serially. Since the
interpreter only reflects the data associated with a single
external message at a time, it is the application's responsibility
to manage the data associated with each external message once that
message has been delivered.</p>
<p>The following example demonstrates asynchronous receipt of an
external message. The catch handler copies the reflected external
message into an array at application scope.</p>
<div class="exampleInner">
<pre>
<vxml version="2.1"
xmlns="http://www.w3.org/2001/vxml">
<property name="externalevents.enable" value="true"/>
<var name="myMessages" expr="new Array()"/>
<catch event="externalmessage">
<var name="lm" expr="application.lastmessage$"/>
<if cond="lm.contenttype == 'text/xml' || lm.contenttype == 'application/xml'">
<log>received XML with root document element
<value expr="lm.content.documentElement.nodeName"/>
</log>
<elseif cond="typeof lm.content == 'string'"/>
<log>received <value expr="lm.content"/></log>
<else/>
<log>received unknown external message type
<value expr="typeof lm.content"/>
</log>
</if>
<script>
myMessages.push({'content' : lm.content, 'ctype' : lm.contenttype});
</script>
</catch>
<form>
<field name="num" type="digits">
<prompt>pick a number any number</prompt>
<catch event="noinput nomatch">
sorry. didn't get that.
<reprompt/>
</catch>
<filled>
you said <value expr="num"/>
<clear/>
</filled>
</field>
</form>
</vxml>
</pre>
</div>
</div>
<div class="div4">
<h5><a name="ExternalCommunicationModule:ReceiveSync"
id="ExternalCommunicationModule:ReceiveSync" />6.13.1.3 Receiving
External Messages Synchronously</h5>
<p>To receive an external message synchronously set the
"externalevents.enable" property to false and the
"externalevents.queue" property to true, and use the
<receive> element to pull messages off the queue.
<receive> blocks until an external message is received or the
timeout specified by the maxtime attribute is exceeded.</p>
<div class="div5">
<h6><a name="ExternalCommunicationModule:ReceiveSyncReceive"
id="ExternalCommunicationModule:ReceiveSyncReceive" />6.13.1.3.1
<receive></h6>
<p>To support receipt of external messages within a voice
application, use the <receive> element. <receive> is
allowed wherever <em>executable content</em> is allowed in
[VXML21], for example a <block> element.</p>
<p><receive> supports the following attributes:</p>
<table>
<caption>Table 66: <receive> properties</caption>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Required</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<th>fetchaudio</th>
<td>See Section 6.1 of [VXML2]. This defaults to the fetchaudio
property described in Section 6.3.5 of [VXML2].</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>fetchaudioexpr</th>
<td>An ECMAScript expression evaluating to the fetchaudio URI. If
evaluation of the expression fails, the interpreter throws
"error.semantic".</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>maxtime</th>
<td>A W3C time specifier indicating the maximum amount of time the
interpreter waits to receive an external message. If the timeout is
exceeded, the interpreter throws "error.badfetch." A value of
"none" indicates the interpreter blocks indefinitely.</td>
<td>No</td>
<td>0s</td>
</tr>
<tr>
<th>maxtimeexpr</th>
<td>An ECMAScript expression evaluating to the maxtime value. If
evaluation of the expression fails, the interpreter throws
"error.semantic".</td>
<td>No</td>
<td>0s</td>
</tr>
</tbody>
</table>
<p>Only one of fetchaudio and fetchaudioexpr can be specified or
"error.badfetch" is thrown.</p>
<p>Only one of maxtime and maxtimeexpr can be specified or
"error.badfetch" is thrown.</p>
<p>When present, the attributes fetchaudioexpr and maxtimeexpr are
evaluated when the <receive> is executed.</p>
<p>The following example demonstrates synchronously receiving an
external message. In this example, the interpreter blocks for up to
15 seconds waiting for an external message to arrive. If no
external message is received during that interval, the interpreter
throws "error.badfetch". If a message is received, the interpreter
proceeds by executing the <log> element.</p>
<div class="exampleInner">
<pre>
<vxml version="2.1"
xmlns="http://www.w3.org/2001/vxml">
<property name="externalevents.queue" value="true"/>
<form>
<catch event="error.badfetch">
<log>timed out waiting for external message</log>
</catch>
<block>
Hold on ...
<receive maxtime="15s"
fetchaudio="http://www.example.com/audio/fetching.wav"/>
<log>got <value expr="application.lastmessage$.content"/></log>
</block>
</form>
</vxml>
</pre>
</div>
</div>
</div>
</div>
<div class="div3">
<h4><a name="ExternalCommunicationModule:Send"
id="ExternalCommunicationModule:Send" />6.13.2 Sending messages
from a voice application</h4>
<p>To send a message from a VoiceXML application to a remote
endpoint, use the <send> element. <send> is allowed
within <em>executable content</em>. Implementations must support
the following attributes:</p>
<table>
<caption>Table 67: <send> Attributes</caption>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Required</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr>
<th>async</th>
<td>A boolean indicating whether or not to block until the final
response to the transaction created by sending the external event
is received, or a timeout.</td>
<td>No</td>
<td>true</td>
</tr>
<tr>
<th>asyncexpr</th>
<td>An ECMAScript expression evaluating to the value of the async
attribute. If evaluation of the expression fails, the interpreter
throws "error.semantic".</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>body</th>
<td>A string representing the data to be sent in the body of the
message.</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>bodyexpr</th>
<td>An ECMAScript expression evaluating to the body of the message
to be sent. If evaluation of the expression fails, the interpreter
throws "error.semantic".</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>contenttype</th>
<td>A string indicating the media type of the body being sent, if
any. The set of content types may be limited by the underlying
platform. If an unsupported media type is specified, the
interpreter throws "error.badfetch.<protocol>.400." The
interpreter is not required to inspect the data specified in the
body to validate that it conforms to the specified media type.</td>
<td>No</td>
<td>text/plain</td>
</tr>
<tr>
<th>contenttypeexpr</th>
<td>An ECMAScript expression evaluating to the media type of the
body. If evaluation of the expression fails, the interpreter throws
"error.semantic".</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>event</th>
<td>The name of the event to send. The value is a string which only
includes alphanumeric characters and the "." (dot) character. The
first character must be a letter. If the value is invalid, then an
"error.badfetch" event is thrown.</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>eventexpr</th>
<td>An ECMAScript expression evaluating to the name of the event to
be sent. If evaluation of the expression fails, the interpreter
throws "error.semantic".</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>fetchaudio</th>
<td>See Section 6.1 of [VXML2]. This defaults to the fetchaudio
property described in Section 6.3.5 of [VXML2].</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>fetchaudioexpr</th>
<td>An ECMAScript expression evaluating to the fetchaudio URI. If
evaluation of the expression fails, the interpreter throws
"error.semantic".</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>namelist</th>
<td>A list of zero or more whitespace-separated variable names to
send. By default, no variables are submitted. Values for these
variables are evaluated when the <send> element is executed.
Only declared variables can be referenced; otherwise,
"error.semantic" is thrown. Variables must be submitted to the
server with the same qualification used in the namelist. When an
ECMAScript variable is submitted to the server, its value must be
converted first into a string before being sent. If the variable is
an ECMAScript object, the mechanism by which it is submitted is
platform-specific. Instead of submitting an ECMAScript object
directly, the application developer can explicitly submit the
individual properties of the object (e.g. "date.month
date.year").</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>target</th>
<td>Specifies the URI to which the event is sent. If the attribute
is not specified, the event is sent to the component which invoked
the VoiceXML session.</td>
<td>No</td>
<td>Invoking component</td>
</tr>
<tr>
<th>targetexpr</th>
<td>An ECMAScript expression evaluating to the target URI. If
evaluation of the expression fails, the interpreter throws
"error.semantic".</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>timeout</th>
<td>See <a
href="#ExternalCommunicationModule:SendTimeout"><b>6.13.2.1
sendtimeout</b></a>. This defaults to the sendtimeout
property.</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<th>timeoutexpr</th>
<td>An ECMAScript expression evaluating to the timeout interval for
a synchronous <send>. If evaluation of the expression fails,
the interpreter throws "error.semantic"</td>
<td>No</td>
<td>N/A</td>
</tr>
</tbody>
</table>
<p>Only one of async and asyncexpr can be specified or
"error.badfetch" is thrown.</p>
<p>Only one of event or eventexpr can be specified or
"error.badfetch" is thrown.</p>
<p>Only one of body, bodyexpr, namelist, event, or eventexpr must
be specified or "error.badfetch" is thrown.</p>
<p>Only one of contenttype and contenttypeexpr can be specified or
"error.badfetch" is thrown.</p>
<p>Only one of fetchaudio and fetchaudioexpr can be specified or
"error.badfetch" is thrown.</p>
<p>Only one of target and targetexpr can be specified or
"error.badfetch" is thrown.</p>
<p>Only one of timeout and timeoutexpr can be specified or
"error.badfetch" is thrown.</p>
<p>When present, the attributes asyncexpr, bodyexpr,
contenttypeexpr, eventexpr, fetchaudioexpr, targetexpr, and
timeoutexpr are evaluated when the <send> is executed.</p>
<p>If a synchronous <send> succeeds, execution proceeds
according to the Form Interpretation Algorithm. If the <send>
times out, the interpreter throws "error.badfetch" to the
application. If the interpreter encounters an error upon sending
the external message, the interpreter throws
"error.badfetch.<protocol>.<status_code>" to the
application. If no status code is available, the interpreter throws
"error.badfetch.<protocol>".</p>
<p>The following example demonstrates the use of <send>
synchronously:</p>
<div class="exampleInner">
<pre>
<vxml version="2.1"
xmlns="http://www.w3.org/2001/vxml">
<form>
<field name="user_id" type="digits">
<prompt>please type your five digit i d</prompt>
<filled>
<send async="false"
bodyexpr="'&lt;userinfo&gt;&lt;id&gt;' + user_id + '&lt;/id&gt;&lt;/userinfo&gt;'"
contenttype="text/xml"/>
<goto next="mainmenu.vxml"/>
</filled>
</field>
</form>
</vxml>
</pre>
</div>
<p>Upon executing an asynchronous <send>, the interpreter
continues execution of the voice application immediately and
disregards the disposition of the message that was sent.</p>
<p>The following example demonstrates the use of <send>
asynchronously:</p>
<div class="exampleInner">
<pre>
<vxml version="2.1"
xmlns="http://www.w3.org/2001/vxml">
<form>
<var name="tasktarget" expr="'http://www.example.com/taskman.pl'"/>
<var name="taskname" expr="'cc'"/>
<var name="taskstate"/>
<block>
<assign name="taskstate" expr="'start'"/>
<send async="true"
targetexpr="tasktarget"
namelist="taskname taskstate"/>
</block>
<field name="ccnum"/>
<field name="expdate"/>
<block>
<assign name="taskstate" expr="'end'"/>
<send async="true"
targetexpr="tasktarget"
namelist="taskname taskstate"/>
</block>
</form>
</vxml>
</pre>
</div>
<div class="div4">
<h5><a name="ExternalCommunicationModule:SendTimeout"
id="ExternalCommunicationModule:SendTimeout" />6.13.2.1
sendtimeout</h5>
<p>The sendtimeout property controls the interval to wait for a
synchronous <send> to return before an "error.badfetch" event
is thrown. The value is a Time Designation as specified in <a
href="http://www.w3.org/TR/2004/REC-voicexml20-20040316/#dml6.5">Section
6.5</a> of [VXML2]. If not specified, the value is derived from the
innermost sendtimeout property.</p>
</div>
</div>
</div>
<div class="div2">
<h3><a name="SessionRootModule" id="SessionRootModule" />6.14
Session Root Module</h3>
<p>The session root module allows for a VXML document to exist
across a VXML session (I.e., transition from one application to
another) similar to the way an application root document allows for
a VXML document to exist across VXML document transitions.</p>
<div class="div3">
<h4><a name="SessionRootModule:Syntax"
id="SessionRootModule:Syntax" />6.14.1 Syntax</h4>
<p>The syntax of the session root module defines the addition of
two attributes on the root <vxml> element. These two new
attributes are summarized below.</p>
<a name="sessionroot:attributes" id="sessionroot:attributes" />
<table>
<caption>Table 68: Table: Two new <vxml> Attributes for
Session Root Module</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>session</th>
<td>URI</td>
<td>URI location of document to be loaded as session root</td>
<td>No</td>
<td>N/A</td>
</tr>
<tr>
<td>requiresession</td>
<td>Boolean</td>
<td>if the error of a duplicated new session root should fail the
document</td>
<td>No</td>
<td>false</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="SessionRootModule:Semantics"
id="SessionRootModule:Semantics" />6.14.2 Semantics</h4>
<p>The session attribute is an optional attribute on vxml tag. It
is a URI reference just like the application attribute is (same URI
resolution). If a VXML session has not yet encountered a document
with a session root then upon encountering the first vxml document
that has a session root, the session root document is loaded and
parsed just like how a normal vxml document would load and parse an
application root document. If a VXML session has already loaded a
different session root then the behavior when a future session
attributes is encountered is controlled by the requiresession
attribute. If the requiresession attribute is true then
encountering a session root attribute with a different URL then the
already loaded session root is an error and an error.badfetch is
generated. If the requiresession attribute is false then the new
session attribute is ignored and the old one is used. The
requiresession attribute defaults to false if not present. The
behavior of the session root is completely the same as the behavior
of the application root, except that while executing in the session
root the vxml browser is allowed to write to the javascript session
scope, and variables declared as child of the vxml tag thus become
session scope variables. In particular, in <a
href="http://www.w3.org/TR/voicexml20/#dml5.1.2">VXML 2.0 section
5.1.2</a> when talking about the variable scopes the text for
application in table 40 is also appropriate for session (new text
"These are declared with <var> and <script> elements
that are children of the session root document's <vxml>
element. They are initialized when the session root document is
loaded. They exist while the session document is loaded, and are
visible to the session root document, the application root
document, and any other loaded application leaf document.").</p>
<p>This session document then is loaded and active in the hierarchy
of documents that follows the javascript scope chaining (that is a
document is below an application root is below a session root).
This means that if a variable is declared in the session root and
then in some local form in the leaf document the variable would be
shadowed (just like how the shadowing from the application
root).</p>
<p>This also implies that the catch selection algorithm as
described in <a
href="http://www.w3.org/TR/voicexml20/#dml5.2.4">VXML 2.0 section
5.2.4</a> would have to change to include the session root document
as a potential source of catch handlers (new text "Form an ordered
list of catches consisting of all catches in the current scope and
all enclosing scopes (form item, form, document, application root
document, session root document, interpreter context), ordered
first by scope (starting with the current scope), and then within
each scope by document order."). Then all catch handling would
remain the same, in particular the as-if-by copy semantics are
retained so if an event from a leaf document was handled by a catch
handler from the session root the catch handler wouldn't execute
within the context of the session root document but would instead
execute as if by copy into the local leaf document context.</p>
<p>This also implies that property lookup from <a
href="http://www.w3.org/TR/voicexml20/#dml6.3">section 6.3 of VXML
2.0</a> would have to change to say that property value lookup can
also go to the session root, if a more local value for the property
isn't found (new text "Properties may be defined for the whole
session, for the whole application, for the whole document at the
<vxml> level, for a particular dialog at the <form> or
<menu> level, or for a particular form item.). This doesn't
change the usual way properties work where a property at a lower
level override one at a higher level.</p>
<p>This also implies that the behavior for link's that are
document-level link of session roots are active which would be a
change to <a href="http://www.w3.org/TR/voicexml20/#dml2.5">section
2.5 of VXML 2.0</a> (new text "If an application root document has
a document-level link, its grammars are active no matter what
document of the application is being executed. If an session root
document has a document-level link, its grammars are active no
matter what document of the session is being executed. If execution
is in a modal form item, then link grammars at the form, document,
application or session level are not active.").</p>
<p>Similar to for links, the scope of grammars from <a
href="http://www.w3.org/TR/voicexml20/#dml3.1.3">section 3.1.3 of
VXML 2.0</a> would be changed to specify what happens when a
grammar from a session root has document scope (new text "Form
grammars are by default given dialog scope, so that they are active
only when the user is in the form. If they are given scope
document, they are active whenever the user is in the document. If
they are given scope document and the document is the application
root document, then they are also active whenever the user is in
another loaded document in the same application. If they are given
scope document and the document is the session root document, then
they are also active throughout the session.". Note that this
active throughout the session can still be trumped by modal listen
states (just like the application root can). <a
href="http://www.w3.org/TR/voicexml20/#dml3.1.4">Section 3.1.4 of
VXML 2.0</a> also changes the activation of grammars bulleted list
to include the session root (new text: "grammars contained in links
in its application root document or session root document, and
grammars for menus and forms in its application root document or
session root document which are given document scope.").</p>
</div>
<div class="div3">
<h4><a name="SessionRootModule:examples"
id="SessionRootModule:examples" />6.14.3 Examples</h4>
<p>For the sake of compactness assume throughout this example that
the single letters used are actually fully qualified URIs. A VXML
document "A" transitions to VXML document "B" which is partially
represented below:</p>
<div class="exampleInner">
<pre>
<vxml session="C" application="D" … >
</pre>
</div>
<p>Before "B" can finish initialization of "B" it loads, parses,
and initializes the VXML documents at both "C" and "D". While
executing in "B" any grammars, properties, links, and variables
included from either "C" or "D" influence execution. Document "B"
then transitions to document "E", with no session attribute,
partially represented below:</p>
<div class="exampleInner">
<pre>
<vxml application="D" … >
</pre>
</div>
<p>While executing in "E" having come from "B", everything from
both "C" and "D" are still active. "D" is still active as we
haven't left the application yet. "C" is still active as we are
part of the same session. Document "E" now transitions to document
"F" partially represented below:</p>
<div class="exampleInner">
<pre>
<vxml application="G" … >
</pre>
</div>
<p>Now, since we have changed applications, the application root
document form "D" is unloaded and grammars, variables, properties,
etc. from "D" are no longer influencing our execution. Document "G"
defines our application root and it, along with "C" which is still
active since we are in the same session, now influence our
execution. Document "F" now transitions to "H" partially
represented below:</p>
<div class="exampleInner">
<pre>
<vxml session="I" … >
</pre>
</div>
<p>Now, since there is already "C" as our session root document
defined we cannot load document "I" and treat this as our session
root. In the absence of requiresession "I" is ignored and "H" is
executed using "C" as our session document. If instead "H" looked
as below:</p>
<div class="exampleInner">
<pre>
<vxml session="I" requiresession="true" … >
</pre>
</div>
<p>Now "H" would fail to load and execution would revert to
document "F" where the appropriate error.badfetch for "H" would be
thrown.</p>
</div>
</div>
<div class="div2">
<h3><a name="RunTimeControl" id="RunTimeControl" />6.15 Run Time
Control Module</h3>
<p>Run time controls are represented by voice or dtmf grammars that
are always active, even when the interpreter is not waiting for
user input (e.g., when transitioning between documents.) When the
grammar representing the rtc is matched, the action specified by
the rtc is taken. When an rtc grammar completes recognition, it is
immediately restarted whether it matched the input or not. Other
grammars, including standard recognition grammars, may be active at
the same time as an rtc.</p>
<div class="div3">
<h4><a name="d3e6567" id="d3e6567" />6.15.1 <rtc></h4>
<div class="div4">
<h5><a name="d3e6570" id="d3e6570" />6.15.1.1 Syntax</h5>
<a name="rtc:attributes" id="rtc:attributes" />
<table>
<caption>Table 69: Table: <rtc> Attributes</caption>
<tbody>
<tr>
<th>grammar</th>
<td>The uri of the grammar defining the rtc.</td>
</tr>
<tr>
<th>priority</th>
<td>The priority of the rtc relative to other rtc grammars.</td>
</tr>
<tr>
<th>action</th>
<td>The action to take when the grammar matches.</td>
</tr>
<tr>
<th>params</th>
<td>One or more parameters that modify the action.</td>
</tr>
<tr>
<th>leadingsilence</th>
<td>Indicates the amount of silence that must precede the
utterance.</td>
</tr>
<tr>
<th>trailingsilence</th>
<td>Indicates the amount of silence that must follow the
utterance.</td>
</tr>
</tbody>
</table>
<p>Possible values for 'action' and 'params' are as follows:</p>
<ul>
<li>volume. Adjusts the volume of prompts. params is a signed
integer indicating number of DBs.</li>
<li>speed. Adjusts the speed of prompts. params is a signed integer
indicating the number of words per minute.</li>
<li>skip. Moves forward or back in the current prompt. params is a
signed integer indicating the number of milliseconds.</li>
<li>cancel. Cancels the execution of the current control item.
Values of params are ignored.</li>
<li>goto. Cancels the execution of the current control item and
jumps to another location. params is a string giving the url of
that location.</li>
</ul>
</div>
</div>
<div class="div3">
<h4><a name="d3e6620" id="d3e6620" />6.15.2 <cancelrtc></h4>
<p><cancelrtc> can be used to cancel an rtc defined by the
<rtc> element. Note that rtcs are identified by their
grammars.</p>
<div class="div4">
<h5><a name="d3e6625" id="d3e6625" />6.15.2.1 Syntax</h5>
<a name="cancelrtc:attributes" id="cancelrtc:attributes" />
<table>
<caption>Table 70: Table: <cancelrtc> Attributes</caption>
<tbody>
<tr>
<th>grammar</th>
<td>The name of the rtc to cancel. '*' cancels all rtcs.</td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Both <rtc> and <cancelrtc>are scoped to the nearest
enclosing control element (<item>,<form>, ...). If not
within a control element, they are scoped to the document they are
in. A given rtc may be defined multiple times within an
application. At any point during execution, the most narrowly
scoped <rtc> or <cancelrtc> element will be in effect.
If an active rtc is turned off by a <cancelrtc> tag, it will
be reactivated when the interpreter leaves the scope of the
<cancelrtc> tag (unless it comes within the scope of another
<cancelrtc> tag). For example, if an <rtc> tag is
scoped to a <form> and a <cancelrtc> tag is scoped to a
field within the <form>, the rtc will be active while the
form is executing, except when it is the field in question.
Application authors may thus use the <rtc> and
<cancelrtc> tags along with the scoping rules to exercize
fine grained control over the activity of rtcs.</p>
<div class="div3">
<h4><a name="d3e6639" id="d3e6639" />6.15.3 Semantics</h4>
<p>Logically rtc grammars behave as a prefilter on the speech
stream, replacing any input they match with silence. Since rtc
grammars operate upstream of normal recognition grammars, the
recognition grammars never see input that matched an rtc grammar.
Thus input that matches an rtc grammar will not trigger barge in,
since barge-in is triggered only by input matching a normal
recognition grammar. Since rtc grammars apply upstream of
recognition grammars, all rtc grammars have, in effect, a higher
priority than any recognition grammar. Thus the priority attribute
on an rtc grammar affects its priority only relative to other rtc
grammars.</p>
<p>When processing speech or type-ahead input, rtcs again apply
upstream of normal speech grammars. Remember also that rtcs may be
active even when the system is not in the wait state, so they may
match the input while it is being entered and other grammars are
not active.</p>
<p>The platform executes the 'volume', 'speed' and 'skip' actions
immediately, as soon as the rtc grammar matches. The platform also
executes the 'cancel' and 'goto' actions automatically, but only
once the interpreter is in an event-processing state. Thus the
platform may complete the processing of non-interruptable tasks
before it processes the 'cancel' or 'goto' actions.</p>
</div>
<div class="div3">
<h4><a name="d3e6648" id="d3e6648" />6.15.4 Examples</h4>
<p>T.B.D.</p>
</div>
</div>
<div class="div2">
<h3><a name="SIV" id="SIV" />6.16 SIV Module</h3>
<p>Speaker biometric resources supported in VoiceXML 3.0 provide
three types of functions:</p>
<ul>
<li>Speaker Verification</li>
<li>Speaker Identification</li>
<li>Speaker Enrollment</li>
</ul>
<p>The following figure shows an overview of the flow of
information in SIV processing:</p>
<p><img class="center" src="Images/overview.png"
alt="Overview of SIV processing information flow" /></p>
<p>The SIV engine computes a match based on one or more utterances
from the user, a voicemodel or reference voice model, thresholds
and other configuration parameters. The results are presented to
VoiceXML in EMMA 1.0 format.</p>
<p>Verification is the process by which a user's utterances are
matched against a pre-computed reference voice model. The next
figure details this process.</p>
<p><img class="center" src="Images/verify.png"
alt="Verification process" /></p>
<p>Verification decisions are based upon a wide variety of
criteria, and applications must choose how to evaluate trade-offs
between application-specific factors:</p>
<a name="SIV:decision" id="SIV:decision" />
<table border="1" cellpadding="2" cellspacing="2"
summary="summary">
<caption>Table 71: Decision/Match Evaluation</caption>
<tbody>
<tr>
<td>Good Enough</td>
<td>
<ul>
<li>Individual and cumulative matches are in the range above the
specified threshold</li>
</ul>
</td>
</tr>
<tr>
<td>More Data Needed</td>
<td>
<ul>
<li>Individual utterance or match was low quality</li>
<li>Below threshold, above abort criteria</li>
<li>Reprompt to collect more data:</li>
<li>
<ul>
<li>discard utterance, collect replacement</li>
<li>keep utterance, add additional</li>
</ul>
</li>
</ul>
</td>
</tr>
<tr>
<td>Abort</td>
<td>
<ul>
<li>Below lower specified threshold</li>
<li>Too many attempts or bad matches</li>
</ul>
</td>
</tr>
</tbody>
</table>
<div class="div3">
<h4><a name="d3e6720" id="d3e6720" />6.16.1 SIV Core Functions</h4>
<p>The core functions of SIV processing are divided into creating a
voice model and enrolling a user in the system (Enrollment) and
using a pre-existing voice model (either Verification or
Identification). Additionally, some engines support adaptation of
an existing voice model based on new user utterances. An SIV dialog
may consist of a sequence of one or more SIV dialog turns.</p>
<p>The SIV resource is defined in terms of a data model and state
model. The data model is composed of the following elements:</p>
<ul>
<li>activeVoiceModel:
<ul>
<li>content: a URI reference to the voice model (or the voice model
itself) with which to perform verification or identification.</li>
<li>properties: type, vendor, etc.</li>
<li>listener: a resource controller associated with this SIV
resource</li>
</ul>
</li>
<li>properties: properties pertaining to the SIV process. These
properties differ depending on the type of the SIV resource type
and function
<ul>
<li>Resource type
<ul>
<li>text-dependent</li>
<li>text-independent</li>
<li>other types</li>
</ul>
</li>
<li>Function
<ul>
<li>Enrollment</li>
<li>Verification</li>
<li>Identification</li>
</ul>
</li>
<li>Platform-specific</li>
</ul>
</li>
<li>controller: the resource controller to which status, results
and error events are sent.</li>
</ul>
<p>An SIV Resource manages SIV devices during a processing
cycle:</p>
<ul>
<li>An SIV cycle is initiated when the resource sends the device an
event instructing it to listen to the input stream.</li>
<li>An SIV cycle is terminated if the device is instructed to stop
by the resource, if the device sends the resource an error event,
or the device ends processing early. When terminated, the device
removes partially or wholly processed input from its buffer and
discards the voicemodel.</li>
<li>During an SIV cycle, the device may send events to the resource
indicating ongoing status.</li>
<li>When the resource receives results from the device during the
SIV cycle, it passes them to its controller. At this point the SIV
cycle is complete and the resource awaits instructions either to
start another SIV cycle or to terminate.</li>
</ul>
</div>
<div class="div3">
<h4><a name="d3e6773" id="d3e6773" />6.16.2 Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<p>The <voicemodel> element has the attributes specified in
Table 72, in addition to the fetchtimeout, fetchhint, maxage, and
maxstale attributes as specified in <a href="#Fetching"><b>8.1.1
Fetching</b></a>.</p>
<a name="SIV:attributes" id="SIV:attributes" />
<table border="1" cellpadding="0" width="99%" summary="summary">
<caption>Table 72: <voicemodel> Attributes</caption>
<tbody>
<tr>
<th>
<p>Name</p>
</th>
<th>
<p>Type</p>
</th>
<th>
<p>Description</p>
</th>
<th>
<p>Required</p>
</th>
<th>
<p>Default Value</p>
</th>
</tr>
<tr>
<th>
<p>mode</p>
</th>
<td>
<p>enroll</p>
<p>verify</p>
<p>identify</p>
</td>
<td>
<p>Defines the mode of SIV function</p>
</td>
<td>
<p>Yes</p>
</td>
<td>
<p><em>None</em></p>
<p><em>If no mode is provided, throw error.badfetch</em></p>
</td>
</tr>
<tr>
<th>
<p>type</p>
</th>
<td>
<p>Text-independent</p>
<p>Text-dependent</p>
<p>[other]</p>
</td>
<td>
<p>Type of speech technology used by the SIV engine</p>
</td>
<td>
<p>No</p>
</td>
<td>
<p><em>None</em></p>
<p>[Should V3 support "other" types?]</p>
</td>
</tr>
<tr>
<th>
<p>identity</p>
</th>
<td>
<p>URI</p>
</td>
<td>
<p>Claim of identity passed to SIV engine to select a voice
model.</p>
</td>
<td>
<p>Yes when mode="verify";</p>
<p>Must not be supplied for mode="identify"</p>
<p>If mode="enroll" and identity URI is provided, a voice model
will be created at the URI specified. Else, the form item variable
will contain the URI of the created voice model.</p>
</td>
<td>
<p>If mode="verify" and no identity is supplied, throw
error.badfetch.</p>
</td>
</tr>
<tr>
<th>
<p>fetchhint</p>
</th>
<td>
<p>One of the values "safe" or "prefetch"</p>
</td>
<td>
<p>Defines when the interpreter context should retrieve content
from the server. prefetch indicates a file may be downloaded when
the page is loaded, whereas safe indicates a file that should only
be downloaded when actually needed.</p>
</td>
<td>
<p>No</p>
</td>
<td>
<p><em>None</em></p>
</td>
</tr>
<tr>
<th>
<p>fetchtimeout</p>
</th>
<td>
<p><a href="#TimeDesignation">Time Designation</a></p>
</td>
<td>
<p>The interval to wait for the content to be returned before
throwing an error.badfetch event.</p>
</td>
<td>
<p>No</p>
</td>
<td>
<p><em>None</em></p>
</td>
</tr>
<tr>
<th>
<p>maxage</p>
</th>
<td>
<p>An unsigned integer</p>
</td>
<td>
<p>Indicates that the document is willing to use content whose age
is no greater than the specified time in seconds (cf. 'max-age' in
HTTP 1.1 [RFC2616]). The document is not willing to use stale
content, unless maxstale is also provided.</p>
</td>
<td>
<p>No</p>
</td>
<td>
<p><em>None</em></p>
</td>
</tr>
<tr>
<th>
<p>maxstale</p>
</th>
<td>
<p>An unsigned integer</p>
</td>
<td>
<p>Indicates that the document is willing to use content that has
exceeded its expiration time (cf. 'max-stale' in HTTP 1.1
[RFC2616]). If maxstale is assigned a value, then the document is
willing to accept content that has exceeded its expiration time by
no more than the specified number of seconds.</p>
</td>
<td>
<p>No</p>
</td>
<td>
<p><em>None</em></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="SIVModule:Semantics" id="SIVModule:Semantics" />6.16.3
Semantics</h4>
<p>The voicemodel RC is the primary RC for the <voicemodel>
element.</p>
<div class="div4">
<h5><a name="d3e7035" id="d3e7035" />6.16.3.1 Definition</h5>
<p>The voicemodel RC is defined in terms of a data model and state
model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this voicemodel RC</li>
<li>properties: fetchtimeout, maxage, maxstale, fetchhint</li>
<li>mode: SIV mode</li>
<li>type: type of speech technology</li>
<li>identity: claim of identity for enroll and verify modes</li>
</ul>
<p>The voicemodel RC's state model consists of the following
states: Idle, Initializing, Ready, and Executing.</p>
<p>[NB: The execution model will follow the process defined for the
grammar RC.]</p>
</div>
<div class="div4">
<h5><a name="d3e1625" id="d3e1625" />6.16.3.2 Defined Events</h5>
<p>The voicemodel RC is defined to receive the following
events:</p>
<a name="SIV:receivedevents" id="SIV:receivedevents" />
<table border="1" cellpadding="0" summary="summary">
<caption>Table 73: Events received by voicemodel RC</caption>
<thead>
<tr>
<td>
<p>Event</p>
</td>
<td>
<p>Source</p>
</td>
<td>
<p>Payload</p>
</td>
<td>
<p>Description</p>
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>initialize</p>
</td>
<td>
<p>any</p>
</td>
<td>
<p>controller(M)</p>
</td>
<td>
<p>causes the element and its children to be initialized</p>
</td>
</tr>
<tr>
<td>
<p>execute</p>
</td>
<td>
<p>controller</p>
</td>
<td>
<p>Adds the grammar to the appropriate Recognition Resource</p>
</td>
<td></td>
</tr>
</tbody>
</table>
<p>and the events it sends:</p>
<a name="SIV:sentevents" id="SIV:sentevents" />
<table border="1" cellpadding="0" summary="summary">
<caption>Table 74: Events sent by voicemodel RC</caption>
<thead>
<tr>
<td>
<p>Event</p>
</td>
<td>
<p>Target</p>
</td>
<td>
<p>Payload</p>
</td>
<td>
<p>Description</p>
</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<p>initialized</p>
</td>
<td>
<p>controller</p>
</td>
<td></td>
<td>
<p>response to initialize event indicating that it has been
successfully initialized</p>
</td>
</tr>
<tr>
<td>
<p>executed</p>
</td>
<td>
<p>controller</p>
</td>
<td></td>
<td>
<p>response to execute event indicating that it has been
successfully executed</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e1694" id="d3e1694" />6.16.3.3 External Events</h5>
<p>The external events sent and received by the voicemodel RC are
those defined in this table:</p>
<a name="SIV:externalevents" id="SIV:externalevents" />
<table border="1" cellpadding="0" summary="summary">
<caption>Table 75: voicemodel RC External Events</caption>
<tbody>
<tr>
<td>
<p>Event</p>
</td>
<td>
<p>Source</p>
</td>
<td>
<p>Target</p>
</td>
<td>
<p>Description</p>
</td>
</tr>
<tr>
<td>
<p>addVoiceModel</p>
</td>
<td>
<p>voicemodelRC</p>
</td>
<td>
<p>SIV Resource</p>
</td>
<td>
<p>Activates voicemodel</p>
</td>
</tr>
<tr>
<td>
<p>createVoiceModel</p>
</td>
<td>
<p>voicemodelRC</p>
</td>
<td>
<p>SIV Resource</p>
</td>
<td>
<p>Creates a new voicemodel</p>
</td>
</tr>
<tr>
<td>
<p>adaptVoiceModel</p>
</td>
<td>
<p>voicemodelRC</p>
</td>
<td>
<p>SIV Resource</p>
</td>
<td>
<p>Adapts the reference voice model based on the current dialog</p>
</td>
</tr>
<tr>
<td>
<p>Prefetch</p>
</td>
<td>
<p>voicemodelRC</p>
</td>
<td>
<p>SIV Resource</p>
</td>
<td>
<p>Requests that the voicemodel be fetched in advance, if
possible</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e7305" id="d3e7305" />6.16.3.4 State Chart
Representation</h5>
<p>[State Chart representation TBD]</p>
</div>
</div>
<div class="div3">
<h4><a name="d3e7310" id="d3e7310" />6.16.4 Events</h4>
<p>The events in this table may be raised during initialization and
execution of the <voicemodel> element.</p>
<a name="SIV:voicemodelevents" id="SIV:voicemodelevents" />
<table border="1" cellpadding="0" summary="summary">
<caption>Table 76: <voicemodel> Events</caption>
<tbody>
<tr>
<td>
<p>Event</p>
</td>
<td>
<p>Description</p>
</td>
<td>
<p>State</p>
</td>
</tr>
<tr>
<td>
<p>error.semantic</p>
</td>
<td>
<p>indicates an error with data model expressions: undefined
reference, invalid expression resolution, etc.</p>
</td>
<td>
<p>execution</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="d3e7351" id="d3e7351" />6.16.5 Examples</h4>
<p>[Examples TBD]</p>
</div>
</div>
<div class="div2">
<h3><a name="SubdialogModule" id="SubdialogModule" />6.17 Subdialog
Module</h3>
<p>TBD</p>
<div class="div3">
<h4><a name="SubdialogModule:Syntax"
id="SubdialogModule:Syntax" />6.17.1 Syntax</h4>
<p>TBD.</p>
<a name="subdialog:attributes" id="subdialog:attributes" />
<table>
<caption>Table 77: Table: Attributes for Subdialog
Element</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="SubdialogModule:Semantics"
id="SubdialogModule:Semantics" />6.17.2 Semantics</h4>
<p>TBD</p>
</div>
<div class="div3">
<h4><a name="SubdialogModule:Examples"
id="SubdialogModule:Examples" />6.17.3 Examples</h4>
<p>TBD</p>
</div>
</div>
<div class="div2">
<h3><a name="DisconnectModule" id="DisconnectModule" />6.18
Disconnect Module</h3>
<p>This module defines the syntactic and semantic features of a
<disconnect> element. The <disconnect> element causes
the interpreter context to disconnect from the user. It provides
the interpreter context a way to enter into final processing state
by throwing the "connection.disconnect.hangup" event. [See ].</p>
<p>Processing the <disconnect> element also causes the
interpreter context to flush the prompt queue before disconnecting
the interpreter context from the user and subsequently throwing
"connection.disconnect.hangup" event.</p>
<p>The attributes and content model of <disconnect> are
specified in <a href="#DisconnectModule:Syntax"><b>6.18.1
Syntax</b></a>. Its semantics are specified in <a
href="#DisconnectModule:Semantics"><b>6.18.2 Semantics</b></a>.</p>
<div class="div3">
<h4><a name="DisconnectModule:Syntax"
id="DisconnectModule:Syntax" />6.18.1 Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<div class="div4">
<h5><a name="d3e7413" id="d3e7413" />6.18.1.1 Attributes</h5>
<p>The <disconnect> element has the attributes specified in
Table 78.</p>
<a name="disconnect:attributes" id="disconnect:attributes" />
<table>
<caption>Table 78: <Disconnect> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>namelist</th>
<td>List of variable names</td>
<td>Variable names to be returned to the interpreter context. The
precise mechanism by which these variables are made available to
the interpreter context is platform specific. If an undeclared
variable is referenced in the namelist, then an error.semantic is
thrown.</td>
<td>No</td>
<td>The default is to return no variables; this means that the
interpreter context will receive an empty ECMAScript object.</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e7446" id="d3e7446" />6.18.1.2 Content Model</h5>
<p>The content model of the <disconnect> element is
empty.</p>
</div>
</div>
<div class="div3">
<h4><a name="DisconnectModule:Semantics"
id="DisconnectModule:Semantics" />6.18.2 Semantics</h4>
<p>The disconnect RC is the primary RC for the <disconnect>
element.</p>
<div class="div4">
<h5><a name="d3e7456" id="d3e7456" />6.18.2.1 Definition</h5>
<p>The disconnect RC is defined in terms of a data model and state
model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this disconnect RC</li>
<li>namelist: list of ECMAScript variables</li>
</ul>
<p>The disconnect RC's state model consists of the following
states: Idle, Initializing, Ready, Executing, and Disconnecting.
The initial state is the Idle state.</p>
<p>While in the Idle state, the RC may receive an 'initialize'
event, whose 'controller' event data is used to update the data
model. The RC then transitions into the Initializing state.</p>
<p>In the Initializing state, the disconnect RC essentially does
nothing. The RC sends the controller an 'initialized' event and
transitions to the Ready state.</p>
<p>In the Ready state, when the disconnect RC receives an 'execute'
event it sends an 'execute' event to the Play RC (<a
href="#PlayModule"><b>6.19 Play Module</b></a>), causing any queued
prompts to be played. Note that the event data passed to Play RC
must have:</p>
<ul>
<li>the controller set to this RC</li>
<li>bargein = false</li>
</ul>
<p>This RC transitions to the Executing state after sending the
event request to the Play RC.</p>
<p>In the Executing state, when the disconnect RC receives the
"playDone" event, it instructs the connection resource to
disconnect the interpreter context from the user and enters into
the "Disconnecting" state.</p>
<p>In the "Disconnecting" state, when the disconnect RC receives
"userDisconnected" event,</p>
<ul>
<li>The namelist variables are tokenized into individual variable
names and their values are obtained using ReadVariable. The way,
values of these individual variables is made available to
interpreter context is platform specific</li>
<li>It throws the "connection.disconnect.hangup" event to the
parent element</li>
<li>It transitions to the Ready state</li>
</ul>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Play RC is not yet defined.</p>
</td>
</tr>
</table>
</div>
<div class="div4">
<h5><a name="d3e7502" id="d3e7502" />6.18.2.2 Defined Events</h5>
<p>The Disconnect RC is defined to receive the following
events:</p>
<table>
<caption>Table 79: Events received by Disconnect RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialize</td>
<td>any</td>
<td>controller(M)</td>
<td>Causes the element to be initialized</td>
</tr>
<tr>
<td>execute</td>
<td>controller</td>
<td />
<td>Causes prompts in the prompt queue to be played</td>
</tr>
</tbody>
</table>
<p>and the events it sends:</p>
<table>
<caption>Table 80: Events sent by Disconnect RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>initialized</td>
<td>controller</td>
<td />
<td>response to initialize event indicating that it has been
successfully initialized</td>
</tr>
<tr>
<td>executed</td>
<td>controller</td>
<td />
<td>Response to execute event indicating that it has been
successfully executed</td>
</tr>
<tr>
<td>error.semantic</td>
<td>controller</td>
<td />
<td>Response to an undeclared variable in namelist</td>
</tr>
<tr>
<td>disconnectUser</td>
<td>Connection Resource</td>
<td />
<td>Instructs interpreter context to disconnect the user</td>
</tr>
<tr>
<td>connection.disconnect.hangup</td>
<td>parent</td>
<td />
<td>Throw this event to the parent element</td>
</tr>
</tbody>
</table>
<p></p>
</div>
<div class="div4">
<h5><a name="d3e7594" id="d3e7594" />6.18.2.3 External Events</h5>
<p>The following table shows the events sent and received by the
Disconnect RC to Resources and other RCs which define the
events.</p>
<a name="disconnect:external-events"
id="disconnect:external-events" />
<table>
<caption>Table 81: Disconnect RC External Events</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Target</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td>execute</td>
<td>Disconnect RC</td>
<td>Play RC</td>
<td /></tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e7621" id="d3e7621" />6.18.2.4 State Chart
Representation</h5>
<p>TBD</p>
</div>
<div class="div4">
<h5><a name="d3e7627" id="d3e7627" />6.18.2.5 SCXML
Representation</h5>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml initialstate="Created">
<datamodel>
<data id="controller"/>
<data id="namelist"/>
<data id="bargein"/>
<data id="activeGrammars"/>
</datamodel>
<state id="Created">
<initial id="Idle"/>
<state id="Idle">
<onentry>
<assign location="$controller" val="null"/>
<assign location="$bargein" val="false"/>
<assign location="$activeGrammars" val="false"/>
</onentry>
<transition event="initialize" target="Initializing">
<assign name="$controller" expr="_eventData/controller"/>
<send target="controller" event="initializing.done" />
</transition>
</state>
<!-- end Idle -->
<state id="Initializing">
<transition event="initializing.done" target="Ready">
<send target="controller" event="initialized"/>
</transition>
</state>
<!-- end Initializing -->
<state id="Ready">
<transition event="execute" target="Executing">
<send target="Play" event="execute"/>
</transition>
</state>
<!-- end Ready -->
<state id="Executing">
<transition event="playDone" target="Disconnecting"> // Currently no such event as "Play.done"
<send target="controller" event="disconnectUser" />
</transition>
</state>
<!-- end Executing -->
<state id="Disconnecting">
<transition event="userDisconnected" target="Ready">
<!-- A call to disconnect the interpreter context from the user -->
<send target="parent" event="connection.disconnect.hangup" />
<send target="controller" event="executed" />
</transition>
</state>
<!-- end Disconnecting -->
</scxml>
</pre>
</div>
</div>
</div>
<div class="div3">
<h4><a name="DisconnectModule:Example"
id="DisconnectModule:Example" />6.18.3 Example</h4>
<div class="exampleInner">
<pre>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<catch event="connection.disconnect.hangup">
<goto next="finalprocessing.jsp" />
</catch>
<form>
<field name="phoneNum" type="digits">
<prompt>Due to some technical difficulties, we cannot process your request now. Please enter your phone number so that we can get back to you later.</prompt>
<catch event="noinput">
Disconnecting.
<disconnect/>
</catch>
<filled>
<disconnect namelist="phoneNum"/>
</filled>
</field>
</form>
</vxml>
</pre>
</div>
</div>
</div>
<div class="div2">
<h3><a name="PlayModule" id="PlayModule" />6.19 Play Module</h3>
<p>This module defines the semantic features of a Play capability.
Note that there is no XML syntax associated with this RC. It is
only used by the Disconnect module (<a
href="#DisconnectModule"><b>6.18 Disconnect Module</b></a>).</p>
<div class="div3">
<h4><a name="PlayModule:Semantics"
id="PlayModule:Semantics" />6.19.1 Semantics</h4>
<p>The Play RC coordinates media output with the PromptQueue
Resource (<a href="#Resources:PromptQueue"><b>5.2 Prompt Queue
Resource</b></a>).</p>
<div class="div4">
<h5><a name="d3e7651" id="d3e7651" />6.19.1.1 Definition</h5>
<p>The PlayRC coordinates media output with the PromptQueue
Resource for scenarios when only prompts need to be played to
completion without doing any recognition.</p>
<p>This RC activates prompt queue playback. The prompt RC is
defined in terms of a data model and state model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this RC</li>
<li>bargein: always set to "false"</li>
</ul>
<p>The Play RC's state model consists of the following states:
Idle, StartPlaying. The initial state is the Idle state.</p>
<p>While in the Idle state, the prompt RC may receive an 'execute'
event, whose event data is used to update the data model. The event
information includes: controller. The RC then transitions to the
StartPlaying state.</p>
<p>In the StartPlaying state, the RC sends a "play" event to the
PromptQueue resource. The PromptQueue returns with a "play.done"
event when all the propmts in the queue are done playing. The Play
RC then sends the "play.done" event to its controller and exits the
RC.</p>
</div>
<div class="div4">
<h5><a name="d3e7672" id="d3e7672" />6.19.1.2 Defined Events</h5>
[Event table contents TBD].
<p>The Play RC is defined to receive the following events:</p>
<table>
<caption>Table 82: Events received by Play RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td />
<td />
<td />
<td /></tr>
</tbody>
</table>
<p>and the events it sends:</p>
<table>
<caption>Table 83: Events sent by Play RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td />
<td />
<td />
<td /></tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e7718" id="d3e7718" />6.19.1.3 External Events</h5>
<p>Table 84 shows the events sent and received by the Play RC to
resources and other RCs which define the events. [Table contents
TBD]</p>
<a name="play:external-events" id="play:external-events" />
<table>
<caption>Table 84: Play RC External Events</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Target</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td />
<td />
<td />
<td /></tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e7743" id="d3e7743" />6.19.1.4 State Chart
Representation</h5>
<img class="center" src="Images/PlayRC.png"
alt="Play RC in UML State Chart" />
<p class="caption">Figure 14: Play RC States</p>
</div>
<div class="div4">
<h5><a name="d3e7749" id="d3e7749" />6.19.1.5 SCXML
Representation</h5>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml initialstate="Created">
<datamodel>
<data id="controller"/>
<data id="bargein"/>
</datamodel>
<state id="Created">
<initial id="Idle"/>
<state id="Idle">
<onentry>
<assign location="$controller" val="null"/>
<assign location="$bargein" val="false"/>
</onentry>
<transition event="execute" target="Playing">
<assign name="$controller" expr="_eventData/controller"/>
<send target="PromptQueue" event="play" namelist="/datamodel/data[@name='bargein']"/>
</transition>
</state> <!-- end Idle -->
<state id="Playing">
<transition event="prompt.done" target="Idle">
<send target="controller" event="playDone"/>
</transition>
</state> <!-- end StartPlaying -->
</state> <!-- end Created -->
</scxml>
</pre>
</div>
</div>
</div>
</div>
<div class="div2">
<h3><a name="RecordModule" id="RecordModule" />6.20 Record
Module</h3>
<p>This module defines the syntactic and semantic features of a
<record> element which collects and stores a recording from
the user.</p>
<p>The attributes and content model of <record> are specified
in <a href="#RecordModule:Syntax"><b>6.20.1 Syntax</b></a>. Its
semantics are specified in <a
href="#RecordModule:Semantics"><b>6.20.2 Semantics</b></a>.</p>
<div class="div3">
<h4><a name="RecordModule:Syntax" id="RecordModule:Syntax" />6.20.1
Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<div class="div4">
<h5><a name="d3e7772" id="d3e7772" />6.20.1.1 Attributes</h5>
<p>The <record> element has the attributes specified in Table
85.</p>
<a name="record:attributes" id="record:attributes" />
<table>
<caption>Table 85: <record> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>name</th>
<td>The name must conform to the variable naming conventions in
(TODO).</td>
<td>The form item variable in the dialog scope that will hold the
recording. The name must be unique among form items in the form. If
the name is not unique, then a badfetch error is thrown when the
document is fetched. Note that how this variable is implemented may
vary between platforms (although all platforms must support its
behavior in <audio> and <submit> as described in this
specification).</td>
<td>Yes</td>
<td /></tr>
<tr>
<th>expr</th>
<td>TBD</td>
<td>The initial value of the form item variable. If initialized to
a value, then the form item will not be visited unless the form
item variable is cleared.</td>
<td>No</td>
<td>ECMAScript undefined</td>
</tr>
<tr>
<th>cond</th>
<td>data model expression</td>
<td>A data model expression that must evaluate to true after
conversion to boolean in order for the form item to be
visited.</td>
<td>No</td>
<td>true</td>
</tr>
<tr>
<th>modal</th>
<td>boolean</td>
<td>If this is true, all non-local speech and DTMF grammars are not
active while making the recording. If this is false, non-local
speech and DTMF grammars are active.</td>
<td>No</td>
<td>true</td>
</tr>
<tr>
<th>beep</th>
<td>boolean</td>
<td>If true, a tone is emitted just prior to recording.</td>
<td>No</td>
<td>false</td>
</tr>
<tr>
<th>maxtime</th>
<td><a title="" href="#TimeDesignation">Time Designation</a></td>
<td>The maximum duration to record.</td>
<td>No</td>
<td>Platform-specific value</td>
</tr>
<tr>
<th>finalsilence</th>
<td><a title="" href="#TimeDesignation">Time Designation</a></td>
<td>The interval of silence that indicates end of speech.</td>
<td>No</td>
<td>Platform-specific value</td>
</tr>
<tr>
<th>dtmfterm</th>
<td>boolean</td>
<td>If true, any DTMF keypress will be treated as a match of an
active (anonymous) local DTMF grammar.</td>
<td>No</td>
<td>true</td>
</tr>
<tr>
<th>type</th>
<td>Required audio file formats specified in <font
color="red"><xref>Appendix E of VoiceXML
2</xref></font> (Other formats may also be supported)</td>
<td>The media format of the resulting recording.</td>
<td>No</td>
<td>Platform-specific (one of the required formats)</td>
</tr>
</tbody>
</table>
</div>
<div class="div4">
<h5><a name="d3e7897" id="d3e7897" />6.20.1.2 Content Model</h5>
<p>The <record> element content model is the same as any
other form input item and consists of:</p>
<ul>
<li><prompt> elements (0 or more)</li>
<li><catch> handlers (0 or more, and may include shorthand
handlers such as noinput, nomatch, etc.)</li>
<li><grammar> elements (0 or more)</li>
<li><link> elements (0 or more)</li>
<li><filled> elements (0 or 1)</li>
<li><property> elements (0 or more)</li>
</ul>
</div>
<div class="div4">
<h5><a name="d3e7915" id="d3e7915" />6.20.1.3 Data Model
Variables</h5>
<p>The <record> module also sets the shadow variables covered
in Table 86 in the data module after the recording has been
made.</p>
<a name="record:shadowvars" id="record:shadowvars" />
<table>
<caption>Table 86: <record> shadow variables</caption>
<tbody>
<tr>
<th>Variable</th>
<th>Description</th>
</tr>
<tr>
<th>name$.duration</th>
<td>The duration of the recording in milliseconds.</td>
</tr>
<tr>
<th>name$.size</th>
<td>The size of the recording in bytes.</td>
</tr>
<tr>
<th>name$.termchar</th>
<td>If the dtmfterm attribute is true, and the user terminates the
recording by pressing a DTMF key, then this shadow variable is the
key pressed (e.g. "#"). Otherwise it is undefined.</td>
</tr>
<tr>
<th>name$.maxtime</th>
<td>Boolean, true if the recording was terminated because the
maxtime duration was reached.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="div3">
<h4><a name="RecordModule:Semantics"
id="RecordModule:Semantics" />6.20.2 Semantics</h4>
<p>The semantics of the record module are defined using the
following resource controllers: RecordInputItem (<a
href="#RC:RecordInputItem"><b>6.20.2.1 RecordInputItem RC</b></a>),
PlayandRecognize (<a href="#RC:PlayAndRecognize"><b>6.10.2.2
PlayandRecognize RC</b></a>), Record (<a
href="#RC:Record"><b>6.20.2.2 Record RC</b></a>).</p>
<div class="div4">
<h5><a name="RC:RecordInputItem" id="RC:RecordInputItem" />6.20.2.1
RecordInputItem RC</h5>
<p>The Record Input Item Resource Controller is the primary RC for
the record element.</p>
<div class="div5">
<h6><a name="d3e7970" id="d3e7970" />6.20.2.1.1 Definition</h6>
<p>The record input item RC is defined in terms of a data model and
a state model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this record input item RC</li>
<li>children: array of children's (primary) RC</li>
<li>includePrompts: boolean indicating whether prompts are to be
collected and queued. Default: true.</li>
<li>promptCounter: prompt counter. Default: 1</li>
<li>eventCounterStructure: A hashtable like structure that stores
the current event count for any given complete named event. If an
event isn't present then it gets a count of 1.</li>
<li>recordResult: this stores a reference to the recorded file (it
is platform specific if this is the data, a URI to the data, a
filename, or what not).</li>
<li>expr: expression for the initial value of the form item</li>
<li>cond: condition if we should be selected</li>
<li>modal: condition if we should have non-local grammars
active</li>
<li>dtmfterm: Boolean if we should terminate on dtmf or not</li>
<li>beep: Boolean if we should play a beep or not</li>
<li>finalsilence: number indicating the length of time we should
wait for record to be done</li>
</ul>
</div>
<div class="div5">
<h6><a name="d3e8002" id="d3e8002" />6.20.2.1.2 Defined Events</h6>
<p>The RecordInputItem RC is defined to receive the following
events:</p>
<p>[Table contents TBD]</p>
<table>
<caption>Table 87: Events received by RecordInputItem RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td />
<td />
<td />
<td />
<td /></tr>
</tbody>
</table>
and the events it sends:
<table>
<caption>Table 88: Events sent by RecordInputItem RC</caption>
<thead>
<tr>
<td>Event</td>
<td>Target</td>
<td>Payload</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td />
<td />
<td />
<td /></tr>
</tbody>
</table>
</div>
<div class="div5">
<h6><a name="d3e8049" id="d3e8049" />6.20.2.1.3 External
Events</h6>
<p>Table 89 shows the events sent and received by the record input
item RC to resources and other RCs which define the events.</p>
<p>[Table contents TBD]</p>
<a name="recordinputitem:external-events"
id="recordinputitem:external-events" />
<table>
<caption>Table 89: RecordInputItem RC External Events</caption>
<thead>
<tr>
<td>Event</td>
<td>Source</td>
<td>Target</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td />
<td />
<td />
<td /></tr>
</tbody>
</table>
</div>
<div class="div5">
<h6><a name="d3e8076" id="d3e8076" />6.20.2.1.4 State Chart
Representation</h6>
<img class="center" src="Images/record_input_item_rc.png"
alt="RecordInputItem RC in UML State Chart" />
<p class="caption">Figure 15: RecordInputItem RC States</p>
</div>
<div class="div5">
<h6><a name="d3e8082" id="d3e8082" />6.20.2.1.5 SCXML
Representation</h6>
</div>
</div>
<div class="div4">
<h5><a name="RC:Record" id="RC:Record" />6.20.2.2 Record RC</h5>
<p>The Record RC coordinates media with the Record resource and a
form item. It is expected that other functionality that may be
related or simultaneous such as prompt playing or recognition will
be handled by the form item's rc. The record RC only handles the
recording.</p>
<div class="div5">
<h6><a name="d3e8092" id="d3e8092" />6.20.2.2.1 Definition</h6>
<p>The record RC is defined in terms of a data model and a state
model.</p>
<p>The data model is composed of the following parameters:</p>
<ul>
<li>controller: the RC controlling this record RC</li>
<li>recordParams: the collection of parameters needed for
recording. This will eventually be broken up but currently the only
ones that effect the RC are timeout and maxtime. Others such as
final silence may be passed directly to the Recording
resource.</li>
</ul>
</div>
<div class="div5">
<h6><a name="d3e8104" id="d3e8104" />6.20.2.2.2 Defined Events</h6>
<p>The Record RC is defined to receive the following events:</p>
<table>
<caption>Table 90: Events received by Record RC</caption>
<thead>
<tr>
<th>Event</th>
<th>Source</th>
<th>Payload</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<th>execute</th>
<td>any</td>
<td>controller (M), recordParams (O)</td>
<td /></tr>
</tbody>
</table>
and the events it sends:
<table>
<caption>Table 91: Events sent by Record RC</caption>
<thead>
<tr>
<th>Event</th>
<th>Target</th>
<th>Payload</th>
<th>Sequencing</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<th>recordDone</th>
<td>controller</td>
<td>RecordResults (M)</td>
<td>One-of: recordDone, noinput</td>
<td /></tr>
<tr>
<th>noinput</th>
<td>controller</td>
<td />
<td>One-of: recordDone, noinput</td>
<td /></tr>
</tbody>
</table>
</div>
<div class="div5">
<h6><a name="d3e8167" id="d3e8167" />6.20.2.2.3 External
Events</h6>
<p>Table 92 shows the events sent by the record RC to various
resources.</p>
<a name="record:sentexternal-events"
id="record:sentexternal-events" />
<table>
<caption>Table 92: External Events sent by Record RC</caption>
<thead>
<tr>
<th>Event</th>
<th>Target</th>
<th>Payload</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<th>start</th>
<td>Timer</td>
<td>timeout (M)</td>
<td /></tr>
<tr>
<th>cancel</th>
<td>Timer</td>
<td />
<td /></tr>
<tr>
<th>start</th>
<td>Record Resource</td>
<td>recoParams (M)</td>
<td /></tr>
<tr>
<th>stop</th>
<td>Record Resource</td>
<td>maxtime (M)</td>
<td>This causes the recording to stop and return the recording
information, setting a Boolean about if the recording was stopped
because of maxtime</td>
</tr>
<tr>
<th>kill</th>
<td>Record Resource</td>
<td />
<td>This immediately stops the record resource, throwing away any
recording</td>
</tr>
<tr>
<th>assign</th>
<td>Datamodel Resource</td>
<td>name (M), value (M)</td>
<td /></tr>
</tbody>
</table>
<p>Table 93 shows the events received by the record RC. Their
definition is provided by the sending component.</p>
<a name="record:receivedexternal-events"
id="record:receivedexternal-events" />
<table>
<caption>Table 93: External Events received by Record RC</caption>
<thead>
<tr>
<th>Event</th>
<th>Source</th>
<th>Payload</th>
<th>Sequencing</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<th>TimerExpired</th>
<td>Timer</td>
<td />
<td />
<td /></tr>
<tr>
<th>Started</th>
<td>Record Resource</td>
<td />
<td />
<td>This event means a recording has begun. This may be automatic
as soon as start was sent to the resource, or there may be an
optimization where this doesn't get sent until after the record
resource detects speech.</td>
</tr>
</tbody>
</table>
</div>
<div class="div5">
<h6><a name="d3e8271" id="d3e8271" />6.20.2.2.4 State Chart
Representation</h6>
<img class="center" src="Images/record_rc.png"
alt="Record RC in UML State Chart" />
<p class="caption">Figure 16: Record RC States</p>
</div>
<div class="div5">
<h6><a name="d3e8277" id="d3e8277" />6.20.2.2.5 SCXML
Representation</h6>
</div>
</div>
</div>
</div>
<div class="div2">
<h3><a name="PropertyModule" id="PropertyModule" />6.21 Property
Module</h3>
<p>The <property> element sets a property value. Properties
are used to set values that affect platform behavior, such as the
recognition process, timeouts, caching policy, etc. For a more
complete list of individual property values see <a
href="#Properties"><b>8.2 Properties</b></a>.</p>
<p>Properties may be defined for the session, for the whole
application, for the whole document at the <vxml> level, for
a particular dialog at the <form> or <menu> level, or
for a particular form item. Properties apply to their parent
element and all the descendants of the parent. A property at a
lower level overrides a property at a higher level. When different
values for a property are specified at the same level, the last one
in document order applies. Properties specified in the session root
document provide default values for properties throughout the
session; properties specified in the application root document
provide default values for properties in every document in the
application; properties specified in an individual document
override property values specified in the application root
document.</p>
<div class="div3">
<h4><a name="PropertyModule:Syntax"
id="PropertyModule:Syntax" />6.21.1 Syntax</h4>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<div class="div4">
<h5><a name="d3e8298" id="d3e8298" />6.21.1.1 Attributes</h5>
<p>The <property> element has the attributes specified in
Table 94.</p>
<a name="property:attributes" id="property:attributes" />
<table>
<caption>Table 94: <property> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>name</th>
<td />
<td>The name of the property</td>
<td>Yes</td>
<td /></tr>
<tr>
<th>value</th>
<td />
<td>A static value of the property</td>
<td>No</td>
<td>(Required if "expr" not present)</td>
</tr>
<tr>
<th>expr</th>
<td>data model expression</td>
<td>A data model expression to be evaluated when the property in
question is used.</td>
<td>No</td>
<td>(Required if "value" not present)</td>
</tr>
</tbody>
</table>
<p>The value and expr attributes are mutually exclusive. A
<property> element may have only one of value and expr
defined.</p>
</div>
<div class="div4">
<h5><a name="d3e8352" id="d3e8352" />6.21.1.2 Content Model</h5>
<p>The content model of the <property> element is empty.</p>
</div>
</div>
<div class="div3">
<h4><a name="PropertyModule:Semantics"
id="PropertyModule:Semantics" />6.21.2 Semantics</h4>
<p>Whenever a particular property needs to be used, its value must
be looked up. The mechanism to lookup the value of a property is
dependent on both the syntactic structure of the authored document
and the current location in execution. The timing of whenever a
property needs to be used is dependent on the property in question.
For instance, the speedvsaccuracy recognizer property needs to have
its value be looked up whenever a recognition is to take place
(like in a <field> tag) but it doesn't need to be looked up
at other times like when a generic prompt is queued in a block or
when a script file is fetched. In contrast, a property like bargein
needs to be looked up whenever a prompt is queued in a block and
the scripttimeout property needs to be looked up whenever a script
file is loaded. For a more complete list of individual properties
and when they are evaluated see section 8 on environment that lists
the various properties and details about them.</p>
<p>When a property is looked up first it must be determined if this
property is defined at the current execution level. If it is then
the last instance of the property element is the one that is
evaluated and used. If no property elements for this property exist
at the current document level then the next higher level XML
container is checked, including going to application root documents
and session root documents. This parent chain is halted whenever
the property is found. The chain of parents to follow for a look up
can span a number of different document elements. For instance it
may have had to be looked up at the current level (I.e., is there a
property defined in the field), the dialog level (I.e., what about
in the form), the document level (I.e., what about in the vxml
element), the application level (I.e., what about the application
root), the session level (I.e., what about the session root). If
the property isn't found at any of these levels then either a
specification specified default or a platform default may need to
be used (see the platform root). For instance the speedvsaccuracy
default value is defined to be 0.5 by the VXML specification. The
completetimeout property however has no specification default and
instead must use a platform default if it is not present.</p>
<p>If the platform has trouble evaluating the value of a property
(I.e., an expr failure) or the value of a property is invalid
(I.e., a completetimeout of "orange") then the platform should
throw error.semantic.</p>
<div class="div4">
<h5><a name="d3e8366" id="d3e8366" />6.21.2.1 Definition</h5>
<p>[Formal definition of data model and state model TBD.]</p>
</div>
<div class="div4">
<h5><a name="d3e8371" id="d3e8371" />6.21.2.2 Defined Events</h5>
<p>[Formal definition of events sent and received TBD.]</p>
</div>
<div class="div4">
<h5><a name="d3e8376" id="d3e8376" />6.21.2.3 External Events</h5>
<p>[Formal definition of external events sent and received
TBD.]</p>
</div>
<div class="div4">
<h5><a name="d3e8381" id="d3e8381" />6.21.2.4 State Chart
Representation</h5>
<p>[State chart TBD.]</p>
</div>
<div class="div4">
<h5><a name="d3e8387" id="d3e8387" />6.21.2.5 SCXML
Representation</h5>
<p>[SCXML representation TBD.]</p>
</div>
</div>
<div class="div3">
<h4><a name="PropertyModule:Events"
id="PropertyModule:Events" />6.21.3 Events</h4>
<p>[Events raised during initialization and execution TBD.]</p>
</div>
<div class="div3">
<h4><a name="property:examples" id="property:examples" />6.21.4
Examples</h4>
<p>[TBD: put all examples here.]</p>
</div>
</div>
<div class="div2">
<h3><a name="ControllerModule" id="ControllerModule" />6.22
Transition Controller Module</h3>
<p>This module defines the syntactic and semantic features of a
<controller> element. Transition controllers provide the
basis for managing flow in VoiceXML applications. Resource
controllers for some elements like <form> have associated
transition controllers which influence how form items get selected
and executed. In addition to form, there is a transition controller
for each of the following higher VoiceXML scopes:</p>
<ul>
<li>A document-level transition controller associated with the
<vxml> element's resource controller that is responsible for
starting document processing and deciding which resource controller
to execute next, i.e., for a <form> or other interaction
element in the document.</li>
<li>An application-level transition controller that is responsible
for starting application processing and deciding which
document-level resource controller to execute next.</li>
<li>A top-level or session transition controller that manages the
flow for a VoiceXML session. This top-level transition controller
is responsible for starting session processing and also holds
session level properties.</li>
</ul>
<p>The above transition controllers influence the selection of the
first form item resource controller to execute, and subsequent ones
through the session.</p>
<p>The attributes and content model of <controller> are
specified in <a href="#ControllerModule:Syntax"><b>6.22.1
Syntax</b></a>. Its semantics are specified in <a
href="#ControllerModule:Semantics"><b>6.22.2 Semantics</b></a>.</p>
<div class="div3">
<h4><a name="ControllerModule:Syntax"
id="ControllerModule:Syntax" />6.22.1 Syntax</h4>
<p>Transition controllers serve as dialog managers for VoiceXML
forms and documents and are described syntactically using the
<controller> element. A VoiceXML 3.0 <form> element or
<vxml> element may have at most one <controller> child,
which allows mixed content.</p>
<p>[See <a href="#Schema"><b>D VoiceXML 3.0 XML Schema</b></a> for
schema definitions].</p>
<div class="div4">
<h5><a name="d3e8433" id="d3e8433" />6.22.1.1 Attributes</h5>
<p>The <controller> element has the attributes specified in
Table 95.</p>
<a name="controller:attributes" id="controller:attributes" />
<table>
<caption>Table 95: <controller> Attributes</caption>
<tbody>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>Default Value</th>
</tr>
<tr>
<th>id</th>
<td>xml:id</td>
<td>This is a document-unique identifier for the <controller>
element. This may be used to register listeners against or dispatch
events to transition controllers in the future.</td>
<td>No</td>
<td /></tr>
<tr>
<th>type</th>
<td>MIME type</td>
<td>This is the MIME type of the transition controller description.
The default transition controller description type is SCXML. The
types supported depend on the VoiceXML 3.0 profile in use.</td>
<td>No</td>
<td>application/xml+scxml</td>
</tr>
<tr>
<th>src</th>
<td>URI</td>
<td>The URI specifying the location of the controller document, if
it is external.</td>
<td>No</td>
<td /></tr>
<tr>
<th>srcexpr</th>
<td>data model expression</td>
<td>Equivalent to src, except that the URI is dynamically
determined by evaluating the content as a data model
expression.</td>
<td>No</td>
<td /></tr>
</tbody>
</table>
At most one of src or srcexpr may be specified</div>
<div class="div4">
<h5><a name="d3e8497" id="d3e8497" />6.22.1.2 Content Model</h5>
<p>The content model is mixed, allowing for both XML and non-XML
content. The type of the content is specified by the "type"
attribute.</p>
</div>
</div>
<div class="div3">
<h4><a name="ControllerModule:Semantics"
id="ControllerModule:Semantics" />6.22.2 Semantics</h4>
<p>The controller RC is the primary RC for the <controller>
element.</p>
<p>Whenever a form item or form or document finishes execution, the
relevant transition controller is consulted for selecting the
subsequent one for execution. To find the relevant transition
controller, begin at the current resource controller and navigate
along the associated VoiceXML element's parent axis until you reach
a resource controller with an associated transition controller. For
example, for a form item, the parent form's resource controller has
the relevant transition controller.</p>
<p>When a transition controller runs to completion, control is
returned to the next higher transition controller along with any
results that need to be passed up. For example, when the last form
item in a form is filled, the transition controller associated with
the form returns control to the document level transition
controller along with the results for the filled form. Control may
be returned to the parent transition controller in case of such run
to completion semantics as well as error semantics.</p>
<div class="div4">
<h5><a name="d3e8511" id="d3e8511" />6.22.2.1 Definition</h5>
TBD</div>
<div class="div4">
<h5><a name="d3e8515" id="d3e8515" />6.22.2.2 Defined Events</h5>
TBD</div>
<div class="div4">
<h5><a name="d3e8519" id="d3e8519" />6.22.2.3 External Events</h5>
TBD</div>
<div class="div4">
<h5><a name="d3e8523" id="d3e8523" />6.22.2.4 State Chart
Representation</h5>
TBD</div>
<div class="div4">
<h5><a name="d3e8527" id="d3e8527" />6.22.2.5 SCXML
Representation</h5>
TBD</div>
</div>
<div class="div3">
<h4><a name="ControllerModule:Events"
id="ControllerModule:Events" />6.22.3 Events</h4>
TBD</div>
<div class="div3">
<h4><a name="controller:examples" id="controller:examples" />6.22.4
Examples</h4>
<p>EXAMPLE 1: If the transition controller is described using an
XML type or vocabulary, the description is a direct child of the
<controller> element.</p>
<div class="exampleInner">
<pre>
<v3:vxml version="3.0" ...>
<!-- document level transition controller, type defaults to SCXML -->
<v3:controller id="controller" type="application/xml+scxml">
<scxml:scxml version="1.0" ...>
<!-- Transition controller as a state chart -->
</scxml:scxml>
</v3:controller>
<!-- Remainder of VoiceXML 3.0 document -->
</v3:vxml>
</pre>
</div>
<p>EXAMPLE 2: If the transition controller is described using a
non-XML type or vocabulary, the description is the text content of
the <controller> element. A CDATA section may be used if
needed.</p>
<div class="exampleInner">
<pre>
<v3:vxml version="3.0" ...>
<!-- document level transition controller -->
<v3:controller id="controller" type="text/some-controller-notation">
<![CDATA[
// Some text-based transition controller description
]]>
</v3:controller>
<!-- Remainder of VoiceXML 3.0 document -->
</v3:vxml>
</pre>
</div>
<p>EXAMPLE 3: [Support for this convenience syntax not yet decided
-- here's the tentative text: If the transition controller is
described using SCXML, then a convenience syntax of placing the
<scxml> root element as a direct child of the <vxml> or
<form> element is supported without the need of a
<controller> wrapper. Thereby, the following two variants are
equivalent:]</p>
<div class="exampleInner">
<pre>
<v3:vxml version="3.0" ...>
<v3:controller>
<scxml:scxml version="1.0" ...>
<!-- Transition controller as a state chart -->
</scxml:scxml>
</v3:controller>
<!-- Remainder of VoiceXML 3.0 document -->
</v3:vxml>
Variant 2:
<v3:vxml version="3.0" ...>
<scxml:scxml version="1.0" ...>
<!-- Transition controller as a state chart -->
</scxml:scxml>
<!-- Remainder of VoiceXML 3.0 document -->
</v3:vxml>
</pre>
</div>
For further examples on using SCXML to describe transition
controllers, see <a href="#Integration:InsideVoiceXML"><b>9.2
Integrating Flow Control Languages into VoiceXML</b></a>.</div>
</div>
</div>
<div class="div1">
<h2><a name="Profiles" id="Profiles" />7 Profiles</h2>
<p>VoiceXML 3.0, like SMIL, is a specification that contains a
variety of functional modules. Not all implementers of VoiceXML
will be interested in implementing all of the functionality defined
in the document. For example, an implementer may have no interest
in speech or DTMF recognition but still be interested in speech
output. An example might be an implementer of book reading products
for the visually impaired. Also, the syntax defined for each of the
VoiceXML 3.0 modules is fairly low-level, and authors familiar with
a more declarative language may wish to have higher-level syntax
that is easier to program in.</p>
<p>To address these interests while maintaining sufficiently
precise behavior definition to enhance portability, we encourage
the use of profiles.</p>
<p>A profile is an implementation of VoiceXML 3 that</p>
<ul>
<li>implements a specified set of VoiceXML 3.0 modules</li>
<li>precisely defines any necessary interaction between the
modules</li>
<li>has its own schema that defines the complete syntax of the
profile</li>
<li>defines conformance requirements for the profile</li>
<li>optionally introduces new elements whose behavior is completely
defined in terms of the core elements defined in the specified set
of modules. These new elements can provide the higher-level
"syntactic sugar" needed to simplify authoring in this language
profile.</li>
</ul>
<p>This specification defines the following profiles:</p>
<ul>
<li>VoiceXML21: supports VoiceXML 2.1 functionality</li>
<li>Media Server: supports advanced media functions (including
DTMF, speech recognition, media playback and control, speech
synthesis and SIV) where results are returned to the control
layer.</li>
<li>Maximal profile: includes all VoiceXML 3.0 modules.</li>
</ul>
<p>It should be possible for other profiles to be created, perhaps
by modifying an existing profile, combining different modules, or
even adding new module functionality and syntax.</p>
<p>Implementers may differ in their choice of which profiles they
implement. Implementers must support a designated set of modules in
order to claim support for VoiceXML 3. That designated set is
TBD.</p>
<p>[ISSUES:</p>
<ul>
<li>who can create profiles? More discussion is needed on whether
profiles should only be created within the Voice Browser Working
Group or by which classes of authors/programmers/implementers
outside of the VBWG.</li>
<li>different dimensions for creation of profiles, e.g. subsets of
core functionality, addition of syntactic sugar/macros,
modification of underlying modules or creation of new ones.</li>
<li>How much modification of module behavior is needed just to
piece together existing modules?</li>
<li>]</li>
</ul>
<div class="div2">
<h3><a name="Profile:Legacy" id="Profile:Legacy" />7.1 Legacy
Profile</h3>
<p>The Legacy profile is included demonstrating how profiles are
defined in VoiceXML 3.0. Using existing elements from the <a
href="#VOICEXML21">[VOICEXML21]</a> specification is helpful as the
semantics of these elements are already well defined and well
understood. Thus changes in how they are presented are a result of
the module and profile style of VoiceXML 3.0 and of making more
explicit and formal the precise detailed semantics.</p>
<p>The Legacy profile also plays a transitional role as VoiceXML
3.0 as a whole is built on top of VoiceXML 2.1. VoiceXML 3.0 is a
superset of VoiceXML 2.1 and includes the traditional 2.1
functionality plus some new modules. The Legacy profile is the set
of modules that were always present in VoiceXML 2.1 but that
weren't expressed in the specification as individual modules. This
also allows a clear path for the VoiceXML application developer as
the application developer will not need to learn substantial new
syntax or semantics when they develop in the Legacy profile of
VoiceXML 3.0.</p>
<p>The Legacy profile also represents a proof of concept to ensure
that the new modular profile method of describing the specification
is in no way limited. VoiceXML 3.0 in its entirety will be in no
way limited or constrained because of the use of profiles and
modules and formalized semantic models. Anything that was
standardized in VoiceXML 2.1 can be standardized in this new format
and the Legacy profile reveals that.</p>
<p>This profile can be best described in the following 3
sections:</p>
<ul>
<li>Module Conformance</li>
<li>Convenience Syntax</li>
<li>Default Handlers and Transition Controllers</li>
</ul>
<div class="div3">
<h4><a name="Legacy:Conformance" id="Legacy:Conformance" />7.1.1
Conformance</h4>
<p>This section defines semantics of how different modules coexist
with each other to simulate the behavior of VoiceXML 2.1. It
outlines all the required modules and any additions/deletions from
each of these modules to make it conform to this profile. It also
talks about the interaction amongst various modules so that
behavior similar to that in VoiceXML 2.1 is achieved.</p>
<p>To conform with this profile, processors must implement the
following modules:</p>
<ul>
<li>Vxml Root Module</li>
<li>Script Module</li>
<li><a href="#FormModule"><b>6.9 Form Module</b></a></li>
<li><a href="#FieldModule"><b>6.10 Field Module</b></a></li>
<li><a href="#PromptModule"><b>6.4 Prompt Module</b></a>: this
includes implementation of <a href="#BuiltinSSMLModule"><b>6.5
Builtin SSML Module</b></a> and <a href="#ForeachModule"><b>6.8
Foreach Module</b></a>.</li>
<li><a href="#Grammar:GrammarModule"><b>6.1 Grammar Module</b></a>:
this includes implementation of <a
href="#Grammar:InlineSRGSGrammarModule"><b>6.2 Inline SRGS Grammar
Module</b></a> and <a href="#Grammar:ExternalGrammarModule"><b>6.3
External Grammar Module</b></a>.</li>
<li><a href="#DAMModule"><b>6.12 Data Access and Manipulation
Module</b></a></li>
<li>Executable Content</li>
<li>Link</li>
<li>Record</li>
<li>Object</li>
<li>Event Throwing/Handling</li>
<li>Transfers</li>
<li>Menu</li>
</ul>
The schema for the Legacy Profile is given in <a
href="#Schema:Legacy"><b>D.8 Schema for Legacy Profile</b></a>.
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>The following content is missing from the Vxml 3.0 specification
and needs to be defined:</p>
<ul>
<li>Vxml Root Module</li>
<li>Event Handling and throwing (event handlers like <catch>,
<noinput>,<nomatch>, etc.)</li>
<li>FIA? (although talked about in the Form module, it is not
addressed completely)</li>
<li>Executable Content</li>
<li><reprompt></li>
<li><disconnect></li>
<li><exit></li>
<li><if> <elseif> <else></li>
<li><goto></li>
<li><submit></li>
<li><log></li>
<li><return></li>
<li><script></li>
<li><throw></li>
<li>All of the VoiceXML 2.0/2.1 properties (Should go in 6.12)</li>
<li><script> Script Module</li>
<li><transfer></li>
<li><initial></li>
<li><link></li>
<li><record></li>
<li><object></li>
<li>Transitions: <goto>, <submit>,
<subdialog></li>
<li>Specify transitions amongst inter-module clearly</li>
<li>author controlled transitions within form</li>
<li>author controlled transitions outside form</li>
<li>automatic transition behavior outside form</li>
<li><filled></li>
</ul>
<p>Supported media types must be defined.</p>
</td>
</tr>
</table>
<div class="div4">
<h5><a name="Legacy:RootRequirements"
id="Legacy:RootRequirements" />7.1.1.1 Vxml Root Module
Requirements</h5>
<p>Eliminate the need to specify Session Root and Platform
Root.</p>
</div>
<div class="div4">
<h5><a name="Legacy:FormRequirements"
id="Legacy:FormRequirements" />7.1.1.2 Form Module
Requirements</h5>
<p>Eliminate Capture phase of DOM Level 3 eventing to support
Legacy Profile.</p>
</div>
<div class="div4">
<h5><a name="Legacy:FieldRequirements"
id="Legacy:FieldRequirements" />7.1.1.3 Field Module
Requirements</h5>
<p>Eliminate Capture phase of DOM Level 3 eventing to support
Legacy Profile.</p>
</div>
<div class="div4">
<h5><a name="Legacy:PromptRequirements"
id="Legacy:PromptRequirements" />7.1.1.4 Prompt Module
Requirements</h5>
<p>Eliminate Capture phase of DOM Level 3 eventing to support
Legacy Profile.</p>
</div>
<div class="div4">
<h5><a name="Legacy:GrammarRequirements"
id="Legacy:GrammarRequirements" />7.1.1.5 Grammar Module
Requirements</h5>
<p>Eliminate Capture phase of DOM Level 3 eventing to support
Legacy Profile.</p>
</div>
<div class="div4">
<h5><a name="Legacy:DataRequirements"
id="Legacy:DataRequirements" />7.1.1.6 Data Access and Manipulation
Module Requirements</h5>
<p>Eliminate Capture phase of DOM Level 3 eventing to support
Legacy Profile.</p>
</div>
</div>
<div class="div3">
<h4><a name="Legacy:Convenience_Syntax"
id="Legacy:Convenience_Syntax" />7.1.2 Convenience Syntax</h4>
<p>This section describes the convenience syntax that can be used
to define some of the functionality of VoiceXML 2.1.</p>
</div>
<div class="div3">
<h4><a name="Legacy:Default" id="Legacy:Default" />7.1.3 Default
Handlers and Transition Controllers</h4>
<p>This section describes what we refer to as the Form
Interpretation Algorithm (FIA) in VoiceXML 2.1 using Transition
Controllers defined in VoiceXML 3.0.</p>
</div>
</div>
<div class="div2">
<h3><a name="Profile:Basic" id="Profile:Basic" />7.2 Basic
Profile</h3>
<div class="div3">
<h4><a name="BasicProfile:Introduction"
id="BasicProfile:Introduction" />7.2.1 Introduction</h4>
<p>The basic profile provides basic media capabilities including
the capture and presentation of temporal media such as audio and
video. The basic profile serves two different purposes:</p>
<ul>
<li>To provide core temporal media services in high-volume
applications, particularly in telecom networks and NGN, IMS,
etc.</li>
<li>To support mobile devices with embedded temporal media
capabilities, especially speech technology.</li>
</ul>
<p>The basic profile is a "lean and mean" collection of media
functions which the application can invoke, but does not duplicate
functions from the scripting or programming languages.</p>
<p>The basic profile is intended for single-turn prompt and collect
applications.</p>
</div>
<div class="div3">
<h4><a name="BasicProfile:Contents"
id="BasicProfile:Contents" />7.2.2 What the Basic Profile
includes</h4>
<p>The following enumerates the modules included in the Basic
Profile.</p>
<div class="div4">
<h5><a name="BasicProfile:SIV" id="BasicProfile:SIV" />7.2.2.1 SIV
functions</h5>
<p>The SIV Module (See <a href="#SIV"><b>6.16 SIV Module</b></a>)
includes verification, identification, and enrollment
functions.</p>
</div>
<div class="div4">
<h5><a name="BasicProfile:Presentation"
id="BasicProfile:Presentation" />7.2.2.2 Presentation
functions</h5>
<p>The Builtin-SSML Module (<a href="#BuiltinSSMLModule"><b>6.5
Builtin SSML Module</b></a>), the Media Module (<a
href="#MediaModule"><b>6.6 Media Module</b></a>), and the Parseq
Module (<a href="#ParseqModule"><b>6.7 Parseq Module</b></a>)
provide functions for presenting information to the user.</p>
</div>
<div class="div4">
<h5><a name="BasicProfile:Capture"
id="BasicProfile:Capture" />7.2.2.3 Capture functions</h5>
<p>Capture functions include</p>
<ul>
<li>The Record module, which captures audio</li>
<li>The Field module (<a href="#FieldModule"><b>6.10 Field
Module</b></a>), which includes the PlayAndRecognize RC</li>
<li>The Grammar module (<a href="#Grammar:GrammarModule"><b>6.1
Grammar Module</b></a>), which includes the Inline SRGS Grammar
module (<a href="#Grammar:InlineSRGSGrammarModule"><b>6.2 Inline
SRGS Grammar Module</b></a>) and the External Grammar Module (<a
href="#Grammar:ExternalGrammarModule"><b>6.3 External Grammar
Module</b></a>)</li>
</ul>
</div>
<div class="div4">
<h5><a name="BasicProfile:Other" id="BasicProfile:Other" />7.2.2.4
Other modules</h5>
<p>The Basic Profile also includes the Data Access and Manipulation
module (<a href="#DAMModule"><b>6.12 Data Access and Manipulation
Module</b></a>) for accessing local variables, parameters, returned
values, etc. This module is not intended to access external
databases.</p>
</div>
</div>
<div class="div3">
<h4><a name="BasicProfile:Results"
id="BasicProfile:Results" />7.2.3 Returned results</h4>
<p>Results are returned using EMMA notation, which may include
includes confidence scores and multiple results represented in a
lattice.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>How does the host scripting or programming language access
returned results?</p>
<p>TBD: define the amount of ECMAScript and data access
capability.</p>
<p>Supported media types must be defined.</p>
</td>
</tr>
</table>
</div>
<div class="div3">
<h4><a name="BasicProfile:NotIncluded"
id="BasicProfile:NotIncluded" />7.2.4 What the Basic Profile does
not include</h4>
<p>The basic profile does NOT support the capture of key strokes,
mouse movements, or joystick movements and does not present static
information such as text and bit map graphics on a display. Other
languages such as HTML, SVG, and XHTML can be used to perform these
functions.</p>
<p>The basic profile does NOT support higher-level flow control
constructs such as the VoiceXML 2.0 <form> element and the
associated Form Interpretation Algorithm. The Basic Profile assumes
that application developers specify flow control using a scripting
or programming language, which controls all application-specific
procedural flow and interaction with non-VoiceXML functions such as
databases, application functions, and Web services.</p>
<p>The following VoiceXML 2.0/2.1 control elements are NOT included
in the Basic Profile:</p>
<ul>
<li><foreach></li>
<li><form> and the associated Form Interpretation Algorithm
(FIA)</li>
<li><goto></li>
<li><submit></li>
<li><exit></li>
<li><return></li>
<li><disconnect></li>
<li><if></li>
<li><else></li>
<li><elseif></li>
<li><reprompt></li>
<li><log></li>
<li><help></li>
<li><link></li>
<li><noinput></li>
<li><nomatch></li>
<li><object></li>
<li><param></li>
<li><subdialog></li>
</ul>
</div>
<div class="div3">
<h4><a name="BasicProfile:Examples"
id="BasicProfile:Examples" />7.2.5 Examples</h4>
<p>Example of an application using SCXML and modules of the basic
profile [tbd]</p>
<p>Example of a programming or scripting language and modules of
the basic profile [tbd]</p>
</div>
</div>
<div class="div2">
<h3><a name="Profile:Maximal" id="Profile:Maximal" />7.3 Maximal
Profile</h3>
<p>The maximal server profile represents the closure over the
VoiceXML 3.0 platform feature set and is intended for applications
providing feature-rich voice user interfaces. This profile provides
data access and manipulation capabilities, full media capabilities,
higher-level flow control constructs such as <form> and
<field>, and full support for environment properties. We
believe that control flow capabilities such as those provided by
SCXML and CCXML are necessary to take full advantage of the
features in the maximal server profile.</p>
<p>Specifically, the maximal server profile provides support for
[... enumerate all modules in Section 6 of WD2 draft ...]</p>
<p>[Issue: Should support for SCXML be required when implementing
the profile? Should support for CCXML be required when implementing
the profile? What are the interoperability ramifications of
requiring one, multiple, or no flow control languages for support
of this profile?]</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Supported media types must be defined.</p>
</td>
</tr>
</table>
</div>
<div class="div2">
<h3><a name="Profile:Enhanced" id="Profile:Enhanced" />7.4 Enhanced
Profile</h3>
<p>At a minimum, the enhanced profile should include the modules
not included in the basic and legacy profiles, specifically SIV and
receive. The enhanced profile may include modules which are
included in the basic and legacy profiles. The enhanced profile
should demonstrate the new capabilities of VoiceXML 3.0, including
prompt control and alternative flow control strategies.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Supported media types must be defined.</p>
</td>
</tr>
</table>
</div>
<div class="div2">
<h3><a name="Profile:ConvenienceSyntax"
id="Profile:ConvenienceSyntax" />7.5 Convenience Syntax (Syntactic
Sugar)</h3>
<p>Profiles can provide convenience syntax to simplify authoring
for that profile without decreasing portability. Convenience
Syntax, as we define it here, can be implemented via a
straightforward text mapping from the convenience syntax to profile
code that uses only the syntax defined by the modules in the
profile. Convenience syntax cannot add functionality. It only makes
existing functionality easier to code.</p>
<p>A Convenience syntax definition must include</p>
<ul>
<li>one or more new XML attributes and/or elements</li>
<li>for each possible use of the new attributes and elements, a
non- cyclical mapping from the code containing the element(s) or
attribute(s) to code containing other convenience syntax or module
syntax, such that the behavior of the original code can be
completely described in terms of module syntax.</li>
<li>(optional) "initial" code to be executed before each
application begins that sets up variables, etc. needed by the
mapped code.</li>
</ul>
<p>The existence and definition of the mapping above means that an
author can write VoiceXML applications using the (presumably
simpler) convenience syntax, while being assured that the code will
execute *as if* the code had been replaced by the (presumably more
complex but well-defined) module syntax. This allows authors to
code simple cases in the convenience syntax, and make use of other
VoiceXML syntax elements and attributes only as needed.</p>
<p><a href="#V2Convenience"><b>E Convenience Syntax in VoiceXML
2.x</b></a> shows how the VoiceXML 2.1 <menu> and pre-defined
catch handlers could be coded using other V2 notation (i.e., as
convenience syntax).</p>
<p>[Examples TBD.]</p>
</div>
</div>
<div class="div1">
<h2><a name="Environment" id="Environment" />8 Environment</h2>
<div class="div2">
<h3><a name="ResourceFetching" id="ResourceFetching" />8.1 Resource
Fetching</h3>
<div class="div3">
<h4><a name="Fetching" id="Fetching" />8.1.1 Fetching</h4>
<p>A VoiceXML interpreter context needs to fetch VoiceXML
documents, and other resources, such as media files, grammars,
scripts, and XML data. Each fetch of the content associated with a
URI is governed by the following attributes:</p>
<table border="1">
<caption>Table 96: Fetch Attributes</caption>
<tbody>
<tr id="Fetching:fetchtimeout">
<th>fetchtimeout</th>
<td>The interval to wait for the content to be returned before
throwing an error.badfetch event. The value is a <a title=""
href="#TimeDesignation">Time Designation</a>. If not specified, a
value derived from the innermost fetchtimeout property is
used.</td>
</tr>
<tr id="Fetching:fetchhint">
<th>fetchhint</th>
<td>Defines when the interpreter context should retrieve content
from the server. prefetch indicates a file may be downloaded when
the page is loaded, whereas safe indicates a file that should only
be downloaded when actually needed. If not specified, a value
derived from the innermost relevant fetchhint property is
used.</td>
</tr>
<tr id="Fetching:maxage">
<th>maxage</th>
<td>Indicates that the document is willing to use content whose age
is no greater than the specified time in seconds (cf. 'max-age' in
HTTP 1.1 <a href="#RFC2616">[RFC2616]</a>). The document is not
willing to use stale content, unless maxstale is also provided. If
not specified, a value derived from the innermost relevant maxage
property, if present, is used.</td>
</tr>
<tr id="Fetching:maxstale">
<th>maxstale</th>
<td>Indicates that the document is willing to use content that has
exceeded its expiration time (cf. 'max-stale' in HTTP 1.1 <a
href="#RFC2616">[RFC2616]</a>). If maxstale is assigned a value,
then the document is willing to accept content that has exceeded
its expiration time by no more than the specified number of
seconds. If not specified, a value derived from the innermost
relevant maxstale property, if present, is used.</td>
</tr>
</tbody>
</table>
<p>When content is fetched from a URI, the fetchtimeout attribute
determines how long to wait for the content (starting from the time
when the resource is needed), and the fetchhint attribute
determines when the content is fetched. The caching policy for a
VoiceXML interpreter context utilizes the maxage and maxstale
attributes and is explained in more detail below.</p>
<p>The fetchhint attribute, in combination with the various
fetchhint properties, is merely a hint to the interpreter context
about when it may schedule the fetch of a resource. Telling the
interpreter context that it may prefetch a resource does not
require that the resource be prefetched; it only suggests that the
resource <em>may</em> be prefetched. However, the interpreter
context is always required to honor the safe fetchhint.</p>
<p>When transitioning from one dialog to another, through either a
<subdialog>, <goto>, <submit>, <link>, or
<choice> element, there are additional rules that affect
interpreter behavior. If the referenced URI names a document (e.g.
"doc#dialog"), or if query data is provided (through POST or GET),
then a new document is obtained (either from a local cache,
intermediate cache, or from a origin Web server). When it is
obtained, the document goes through its initialization phase (i.e.,
obtaining and initializing a new application root document if
needed, initializing document variables, and executing document
scripts). The requested dialog (or first dialog if none is
specified) is then initialized and execution of the dialog
begins.</p>
<p>Generally, if a URI reference contains only a fragment (e.g.,
"#my_dialog"), then no document is fetched, and no initialization
of that document is performed. However, <submit> always
results in a fetch, and if a fragment is accompanied by a namelist
attribute there will also be a fetch.</p>
<p>Another exception is when a URI reference in a leaf document
references the application root document. In this case, the root
document is transitioned to without fetching and without
initialization even if the URI reference contains an absolute or
relative URI (see <a href="#ApplicationRoot"><b>4.5.2.2 Application
Root</b></a> and <a href="#RFC2396">[RFC2396]</a>). However, if the
URI reference to the root document contains a query string or a
namelist attribute, the root document is fetched.</p>
<p>Elements that fetch VoiceXML documents also support the
following additional attribute:</p>
<table border="1">
<caption>Table 97: Additional Fetch Attribute</caption>
<tbody>
<tr>
<th>fetchaudio</th>
<td>The URI of the audio clip to play while the fetch is being
done. If not specified, the fetchaudio property is used, and if
that property is not set, no audio is played during the fetch. The
fetching of the audio clip is governed by the audiofetchhint,
audiomaxage, audiomaxstale, and fetchtimeout properties in effect
at the time of the fetch. The playing of the audio clip is governed
by the fetchaudiodelay, and fetchaudiominimum properties in effect
at the time of the fetch.</td>
</tr>
</tbody>
</table>
<p>The fetchaudio attribute is useful for enhancing a user
experience when there may be noticeable delays while the next
document is retrieved. This can be used to play background music,
or a series of announcements. When the document is retrieved, the
audio file is interrupted if it is still playing. If an error
occurs retrieving fetchaudio from its URI, no badfetch event is
thrown and no audio is played during the fetch.</p>
</div>
<div class="div3">
<h4><a name="Caching" id="Caching" />8.1.2 Caching</h4>
<p>The VoiceXML interpreter context, like <a href="#">[HTML]</a>
visual browsers, can use caching to improve performance in fetching
documents and other resources; audio recordings (which can be quite
large) are as common to VoiceXML documents as images are to HTML
pages. In a visual browser it is common to include end user
controls to update or refresh content that is perceived to be
stale. This is not the case for the VoiceXML interpreter context,
since it lacks equivalent end user controls. Thus enforcement of
cache refresh is at the discretion of the document through
appropriate use of the maxage, and maxstale attributes.</p>
<p>The caching policy used by the VoiceXML interpreter context must
adhere to the cache correctness rules of HTTP 1.1 (<a
href="#RFC2616">[RFC2616]</a>). In particular, the Expires and
Cache-Control headers must be honored. The following algorithm
summarizes these rules and represents the interpreter context
behavior when requesting a resource:</p>
<ul>
<li>If the resource is not present in the cache, fetch it from the
server using get.</li>
<li>If the resource is in the cache,
<ul>
<li>If a maxage value is provided,
<ul>
<li>If age of the cached resource <= maxage,
<ul>
<li>If the resource has expired,
<ul>
<li>Perform maxstale check.</li>
</ul>
</li>
<li>Otherwise, use the cached copy.</li>
</ul>
</li>
<li>Otherwise, fetch it from the server using get.</li>
</ul>
</li>
<li>Otherwise,
<ul>
<li>If the resource has expired,
<ul>
<li>Perform maxstale check.</li>
</ul>
</li>
<li>Otherwise, use the cached copy.</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>The "maxstale check" is:</p>
<ul>
<li>If maxstale is provided,
<ul>
<li>If cached copy has exceeded its expiration time by no more than
maxstale seconds, then use the cached copy.</li>
<li>Otherwise, fetch it from the server using get.</li>
</ul>
</li>
<li>Otherwise, fetch it from the server using get.</li>
</ul>
<p>Note: it is an optimization to perform a "get if modified" on a
document still present in the cache when the policy requires a
fetch from the server.</p>
<p>The maxage and maxstale properties are allowed to have no
default value whatsoever. If the value is not provided by the
document author, and the platform does not provide a default value,
then the value is undefined and the 'Otherwise' clause of the
algorithm applies. All other properties must provide a default
value (either as given by the specification or by the
platform).</p>
<p>While the maxage and maxstale attributes are drawn from and
directly supported by HTTP 1.1, some resources may be addressed by
URIs that name protocols other than HTTP. If the protocol does not
support the notion of resource age, the interpreter context shall
compute a resource's age from the time it was received. If the
protocol does not support the notion of resource staleness, the
interpreter context shall consider the resource to have expired
immediately upon receipt.</p>
<div class="div4">
<h5><a name="Controlling_the_Caching_Policy"
id="Controlling_the_Caching_Policy" />8.1.2.1 Controlling the
Caching Policy</h5>
<p>VoiceXML allows the author to override the default caching
behavior for each use of each resource (except for any document
referenced by the <vxml> element's application attribute:
there is no markup mechanism to control the caching policy for an
application root document).</p>
<p>Each resource-related element may specify maxage and maxstale
attributes. Setting maxage to a non-zero value can be used to get a
fresh copy of a resource that may not have yet expired in the
cache. A fresh copy can be unconditionally requested by setting
maxage to zero.</p>
<p>Using maxstale enables the author to state that an expired copy
of a resource, that is not too stale (according to the rules of
HTTP 1.1), may be used. This can improve performance by eliminating
a fetch that would otherwise be required to get a fresh copy. It is
especially useful for authors who may not have direct server-side
control of the expiration dates of large static files.</p>
</div>
</div>
<div class="div3">
<h4><a name="Prefetching" id="Prefetching" />8.1.3 Prefetching</h4>
<p>Prefetching is an optional feature that an interpreter context
may implement to obtain a resource before it is needed. A resource
that may be prefetched is identified by an element whose fetchhint
attribute equals "prefetch". When an interpreter context does
prefetch a resource, it must ensure that the resource fetched is
precisely the one needed. In particular, if the URI is computed
with an expr attribute, the interpreter context must not move the
fetch up before any assignments to the expression's variables.
Likewise, the fetch for a <submit> must not be moved prior to
any assignments of the namelist variables.</p>
<p>The expiration status of a resource must be checked on each use
of the resource, and, if its fetchhint attribute is "prefetch",
then it is prefetched. The check must follow the caching policy
specified in Section 6.1.2.</p>
</div>
<div class="div3">
<h4><a name="Protocols" id="Protocols" />8.1.4 Protocols</h4>
<p>The "http" URI scheme must be supported by VoiceXML platforms,
the "https" protocol should be supported and other URI protocols
may be supported.</p>
</div>
</div>
<div class="div2">
<h3><a name="Properties" id="Properties" />8.2 Properties</h3>
<p>Properties are used to set values that affect platform behavior,
such as the recognition process, timeouts, caching policy, etc.</p>
<p>The following types of properties are defined: speech
recognition (<a href="#Properties:ASR"><b>8.2.1 Speech Recognition
Properties</b></a>), DTMF recognition (<a
href="#Properties:DTMF"><b>8.2.2 DTMF Recognition
Properties</b></a>), prompt and collect (<a
href="#Properties:PromptandCollect"><b>8.2.3 Prompt and Collect
Properties</b></a>), media (<a href="#Properties:Media"><b>8.2.4
Media Properties</b></a>), fetching (<a
href="#Properties:Fetch"><b>8.2.5 Fetch Properties</b></a>) and
miscellaneous (<a href="#Properties:Misc"><b>8.2.6 Miscellaneous
Properties</b></a>) properties.</p>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">
<p>Open issue: should the specification provide specific default
values rather than platform-specific?</p>
<p>Open issue: Should we add a 'type' column for all
properties?</p>
</td>
</tr>
</table>
<div class="div3">
<h4><a name="Properties:ASR" id="Properties:ASR" />8.2.1 Speech
Recognition Properties</h4>
<p>The following generic speech recognition properties are
defined.</p>
<table border="1">
<caption>Table 98: Speech Recognition Properties</caption>
<tbody>
<tr>
<th>Name</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<th>confidencelevel</th>
<td>The speech recognition confidence level, a float value in the
range of 0.0 to 1.0. Results are rejected (a nomatch event is
thrown) when application.lastresult$.confidence is below this
threshold. A value of 0.0 means minimum confidence is needed for a
recognition, and a value of 1.0 requires maximum confidence. The
value is a Real Number Designation (see <a
href="#ValueDesignations"><b>8.4 Value Designations</b></a>).</td>
<td>0.5</td>
</tr>
<tr>
<th>sensitivity</th>
<td>Set the sensitivity level. A value of 1.0 means that it is
highly sensitive to quiet input. A value of 0.0 means it is least
sensitive to noise. The value is a Real Number Designation (see <a
href="#ValueDesignations"><b>8.4 Value Designations</b></a>).</td>
<td>0.5</td>
</tr>
<tr>
<th>speedvsaccuracy</th>
<td>A hint specifying the desired balance between speed vs.
accuracy. A value of 0.0 means fastest recognition. A value of 1.0
means best accuracy. The value is a Real Number Designation (see <a
href="#ValueDesignations"><b>8.4 Value Designations</b></a>).</td>
<td>0.5</td>
</tr>
<tr>
<th>completetimeout</th>
<td>The length of silence required following user speech before the
speech recognizer finalizes a result (either accepting it or
throwing a nomatch event). The complete timeout is used when the
speech is a complete match of an active grammar. By contrast, the
incomplete timeout is used when the speech is an incomplete match
to an active grammar. A long complete timeout value delays the
result completion and therefore makes the computer's response slow.
A short complete timeout may lead to an utterance being broken up
inappropriately. Reasonable complete timeout values are typically
in the range of 0.3 seconds to 1.0 seconds. The value is a Time
Designation (see <a href="#ValueDesignations"><b>8.4 Value
Designations</b></a>). See <a href="#Timing_Properties"><b>8.3
Speech and DTMF Input Timing Properties</b></a>. Although platforms
must parse the completetimeout property, platforms are not required
to support the behavior of completetimeout. Platforms choosing not
to support the behavior of completetimeout must so document and
adjust the behavior of the <em>incompletetimeout</em> property as
described below.</td>
<td>platform-dependent</td>
</tr>
<tr>
<th>incompletetimeout</th>
<td>The required length of silence following user speech after
which a recognizer finalizes a result. The incomplete timeout
applies when the speech prior to the silence is an incomplete match
of all active grammars. In this case, once the timeout is
triggered, the partial result is rejected (with a nomatch event).
The incomplete timeout also applies when the speech prior to the
silence is a complete match of an active grammar, but where it is
possible to speak further and still match the grammar. By contrast,
the complete timeout is used when the speech is a complete match to
an active grammar and no further words can be spoken. A long
incomplete timeout value delays the result completion and therefore
makes the computer's response slow. A short incomplete timeout may
lead to an utterance being broken up inappropriately. The
incomplete timeout is usually longer than the complete timeout to
allow users to pause mid-utterance (for example, to breathe). See
<a href="#Timing_Properties"><b>8.3 Speech and DTMF Input Timing
Properties</b></a> Platforms choosing not to support the
<em>completetimeout</em> property (described above) must use the
maximum of the completetimeout and incompletetimeout values as the
value for the incompletetimeout. The value is a Time Designation
(see <a href="#ValueDesignations"><b>8.4 Value
Designations</b></a>).</td>
<td>undefined?</td>
</tr>
<tr>
<th>maxspeechtimeout</th>
<td>The maximum duration of user speech. If this time elapsed
before the user stops speaking, the event "maxspeechtimeout" is
thrown. The value is a Time Designation (see <a
href="#ValueDesignations"><b>8.4 Value Designations</b></a>).</td>
<td>platform-dependent</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="Properties:DTMF" id="Properties:DTMF" />8.2.2 DTMF
Recognition Properties</h4>
<p>The following generic DTMF recognition properties are
defined.</p>
<table border="1">
<caption>Table 99: DTMF Recognition Properties</caption>
<tbody>
<tr>
<th>Name</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<th>interdigittimeout</th>
<td>The inter-digit timeout value to use when recognizing DTMF
input. The value is a Time Designation (see <a
href="#ValueDesignations"><b>8.4 Value Designations</b></a>). See
<a href="#Timing_Properties"><b>8.3 Speech and DTMF Input Timing
Properties</b></a>.</td>
<td>platform-dependent</td>
</tr>
<tr>
<th>termtimeout</th>
<td>The terminating timeout to use when recognizing DTMF input. The
value is a Time Designation (see <a
href="#ValueDesignations"><b>8.4 Value Designations</b></a>). <a
href="#Timing_Properties"><b>8.3 Speech and DTMF Input Timing
Properties</b></a>.</td>
<td>0s</td>
</tr>
<tr>
<th>termchar</th>
<td>The terminating DTMF character for DTMF input recognition. See
<a href="#Timing_Properties"><b>8.3 Speech and DTMF Input Timing
Properties</b></a>.</td>
<td>#</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="Properties:PromptandCollect"
id="Properties:PromptandCollect" />8.2.3 Prompt and Collect
Properties</h4>
<p>The following properties are defined to apply to the fundamental
platform prompt and collect cycle.</p>
<table border="1">
<caption>Table 100: Prompt and Collect Properties</caption>
<tbody>
<tr>
<th>Name</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr id="Property:bargein">
<th>bargein</th>
<td>The bargein attribute to use for prompts. Setting this to true
allows bargein by default. Setting it to false disallows
bargein.</td>
<td>true</td>
</tr>
<tr id="Property:bargeintype">
<th>bargeintype</th>
<td>Sets the type of bargein to be speech or hotword. See "Bargein
type" (link TBD).</td>
<td>platform-specific</td>
</tr>
<tr id="Property:timeout">
<th>timeout</th>
<td>The time after which a noinput event is thrown by the platform.
The value is a Time Designation (see <a
href="#ValueDesignations"><b>8.4 Value Designations</b></a>). See
<a href="#Timing_Properties"><b>8.3 Speech and DTMF Input Timing
Properties</b></a>.</td>
<td>platform-dependent</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="Properties:Media" id="Properties:Media" />8.2.4 Media
Properties</h4>
<p>The following properties are defined to apply to output
media.</p>
<table border="1">
<caption>Table 101: Media Properties</caption>
<tbody>
<tr>
<th>Name</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr id="Property:outputmodes">
<th>outputmodes</th>
<td>
<p>Determines which modes may be used for media output. The value
is a space separated list of media types (see media 'type' in
TBD).</p>
<p>This property is typically used with container file formats,
such as "video/3gpp", which support storage of multiple media
types. For example, to play both audio and video to the remote
connection, the property would be set to "audio video". To play
only the video, the property is set to "video".</p>
<p>If the value contains a media type which is not supported by the
platform, the connection or the value of the <media> element
<code>type</code> property, then that media type is ignored.</p>
</td>
<td>The default value depends on the negotiated media between the
local and remote devices. It is the space separated list of media
types specified in the <code>session.connection.media</code> array
elements' <code>type</code> property where the associated
<code>direction</code> property is <code>sendrecv</code> or
<code>recvonly</code>.</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="Properties:Fetch" id="Properties:Fetch" />8.2.5 Fetch
Properties</h4>
<p>The following properties pertain to the fetching of new
documents and resources.</p>
<p>Note that maxage and maxstale properties may have no default
value - see <a href="#Caching"><b>8.1.2 Caching</b></a>.</p>
<table border="1">
<caption>Table 102: Fetch Properties</caption>
<tbody>
<tr>
<th>Name</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr id="Property:audiofetchhint">
<th>audiofetchhint</th>
<td>This tells the platform whether or not it can attempt to
optimize dialog interpretation by pre-fetching audio. The value is
either safe to say that audio is only fetched when it is needed,
never before; or prefetch to permit, but not require the platform
to pre-fetch the audio.</td>
<td>prefetch</td>
</tr>
<tr id="Property:audiofetchtimeout">
<th>audiofetchtimeout</th>
<td>The timeout for audio fetches. The value is a Time Designation
(see <a href="#ValueDesignations"><b>8.4 Value
Designations</b></a>).</td>
<td>platform-specific</td>
</tr>
<tr id="Property:audiomaxage">
<th>audiomaxage</th>
<td>Tells the platform the maximum acceptable age, in seconds, of
cached audio resources.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:audiomaxstale">
<th>audiomaxstale</th>
<td>Tells the platform the maximum acceptable staleness, in
seconds, of expired cached audio resources.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:documentfetchhint">
<th>documentfetchhint</th>
<td>Tells the platform whether or not documents may be pre-fetched.
The value is either safe (the default), or prefetch.</td>
<td>safe</td>
</tr>
<tr id="Property:documentfetchtimeout">
<th>documentfetchtimeout</th>
<td>The timeout for document fetches. The value is a Time
Designation (see <a href="#ValueDesignations"><b>8.4 Value
Designations</b></a>).</td>
<td>platform-specific</td>
</tr>
<tr id="Property:documentmaxage">
<th>documentmaxage</th>
<td>Tells the platform the maximum acceptable age, in seconds, of
cached documents.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:documentmaxstale">
<th>documentmaxstale</th>
<td>Tells the platform the maximum acceptable staleness, in
seconds, of expired cached documents.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:grammarfetchhint">
<th>grammarfetchhint</th>
<td>Tells the platform whether or not grammars may be pre-fetched.
The value is either prefetch (the default), or safe.</td>
<td>prefetch</td>
</tr>
<tr id="Property:grammarfetchtimeout">
<th>grammarfetchtimeout</th>
<td>The timeout for grammar fetches. The value is a Time
Designation (see <a href="#ValueDesignations"><b>8.4 Value
Designations</b></a>).</td>
<td>platform-specific</td>
</tr>
<tr id="Property:grammarmaxage">
<th>grammarmaxage</th>
<td>Tells the platform the maximum acceptable age, in seconds, of
cached grammars.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:grammarmaxstale">
<th>grammarmaxstale</th>
<td>Tells the platform the maximum acceptable staleness, in
seconds, of expired cached grammars.</td>
<td>platform-specific.</td>
</tr>
<tr id="Property:mediafetchhint">
<th>mediafetchhint</th>
<td>Tells the platform whether or not media files may be
pre-fetched. The value is either prefetch (the default), or
safe.</td>
<td>prefetch</td>
</tr>
<tr id="Property:mediafetchtimeout">
<th>mediafetchtimeout</th>
<td>The timeout for media fetches. The value is a Time Designation
(see <a href="#ValueDesignations"><b>8.4 Value
Designations</b></a>).</td>
<td>platform-specific</td>
</tr>
<tr id="Property:mediamaxage">
<th>mediamaxage</th>
<td>Tells the platform the maximum acceptable age, in seconds, of
cached media.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:mediamaxstale">
<th>mediamaxstale</th>
<td>Tells the platform the maximum acceptable staleness, in
seconds, of expired cached media.</td>
<td>platform-specific.</td>
</tr>
<tr id="Property:objectfetchhint">
<th>objectfetchhint</th>
<td>Tells the platform whether the URI contents for <object>
may be pre-fetched or not. The values are prefetch, or safe.</td>
<td>prefetch</td>
</tr>
<tr id="Property:objectfetchtimeout">
<th>objectfetchtimeout</th>
<td>The timeout for objectfetches. The value is a Time Designation
(see <a href="#ValueDesignations"><b>8.4 Value
Designations</b></a>).</td>
<td>platform-specific</td>
</tr>
<tr id="Property:objectmaxage">
<th>objectmaxage</th>
<td>Tells the platform the maximum acceptable age, in seconds, of
cached objects.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:objectmaxstale">
<th>objectmaxstale</th>
<td>Tells the platform the maximum acceptable staleness, in
seconds, of expired cached objects.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:scriptfetchhint">
<th>scriptfetchhint</th>
<td>Tells whether scripts may be pre-fetched or not. The values are
prefetch (the default), or safe.</td>
<td>prefetch</td>
</tr>
<tr id="Property:scriptfetchtimeout">
<th>scriptfetchtimeout</th>
<td>The timeout for script fetches. The value is a Time Designation
(see <a href="#ValueDesignations"><b>8.4 Value
Designations</b></a>).</td>
<td>platform-specific</td>
</tr>
<tr id="Property:scriptmaxage">
<th>scriptmaxage</th>
<td>Tells the platform the maximum acceptable age, in seconds, of
cached scripts.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:scriptmaxstale">
<th>scriptmaxstale</th>
<td>Tells the platform the maximum acceptable staleness, in
seconds, of expired cached scripts.</td>
<td>platform-specific.</td>
</tr>
<tr id="Property:fetchaudio">
<th>fetchaudio</th>
<td>The URI of the audio to play while waiting for a document to be
fetched. The default is not to play any audio during fetch delays.
There are no fetchaudio properties for audio, grammars, objects,
and scripts. The fetching of the audio clip is governed by the
audiofetchhint, audiomaxage, audiomaxstale, and fetchtimeout
properties in effect at the time of the fetch. The playing of the
audio clip is governed by the fetchaudiodelay, and
fetchaudiominimum properties in effect at the time of the
fetch.</td>
<td>undefined</td>
</tr>
<tr id="Property:fetchaudiodelay">
<th>fetchaudiodelay</th>
<td>The time interval to wait at the start of a fetch delay before
playing the fetchaudio source. The value is a Time Designation (see
<a href="#ValueDesignations"><b>8.4 Value Designations</b></a>).
The default interval is platform-dependent, e.g. "2s". The
idea is that when a fetch delay is short, it may be better to have
a few seconds of silence instead of a bit of fetchaudio that is
immediately cut off.</td>
<td>platform-specific</td>
</tr>
<tr id="Property:fetchaudiominimum">
<th>fetchaudiominimum</th>
<td>The minimum time interval to play a fetchaudio source, once
started, even if the fetch result arrives in the meantime. The
value is a Time Designation (see <a
href="#ValueDesignations"><b>8.4 Value Designations</b></a>). The
default is platform-dependent, e.g., "5s". The idea is that
once the user does begin to hear fetchaudio, it should not be
stopped too quickly.</td>
<td>platform-specific</td>
</tr>
</tbody>
</table>
</div>
<div class="div3">
<h4><a name="Properties:Misc" id="Properties:Misc" />8.2.6
Miscellaneous Properties</h4>
<p>The following miscellaneous properties are defined.</p>
<table border="1">
<caption>Table 103: Miscellaneous Properties</caption>
<tbody>
<tr>
<th>Name</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<th>inputmodes</th>
<td>This property determines which input modality to use. The input
modes to enable: dtmf and voice. On platforms that support both
modes, inputmodes defaults to "dtmf voice". To disable speech
recognition, set inputmodes to "dtmf". To disable DTMF, set it to
"voice". One use for this would be to turn off speech recognition
in noisy environments. Another would be to conserve speech
recognition resources by turning them off where the input is always
expected to be DTMF. This property does not control the activation
of grammars. For instance, voice-only grammars may be active when
the inputmode is restricted to DTMF. Those grammars would not be
matched, however, because the voice input modality is not
active.</td>
<td>???</td>
</tr>
<tr>
<th>universals</th>
<td>Platforms may optionally provide platform-specific universal
command grammars, such as "help", "cancel", or "exit" grammars,
that are always active (except in the case of modal input items -
see "Activation of Grammars" (link TBD)) and which generate
specific events. Note that relying on platform-provided grammars is
not good practice for production-grade applications (see <a
href="#BuiltinModule"><b>6.11 Builtin Grammar Module</b></a>).
Applications choosing to migrate from universals grammars to a more
the robust developer-specified grammars should replace the
universals <property> with one or more <link> (TODO,
hyperlink) element(s). Because <link>s can also generate the
same events as universal grammars, and because the <catch>
handlers for the universal grammars persist outside the universals
<property>, the migration should be seamless. The value
"none" is the default, and means that all platform default
universal command grammars are disabled. The value "all" turns them
all on. Individual grammars are enabled by listing their names
separated by spaces; for example, "cancel exit help".</td>
<td>none</td>
</tr>
<tr>
<th>maxnbest</th>
<td>This property controls the maximum size of the
"application.lastresult$" array; the array is constrained to be no
larger than the value specified by 'maxnbest'. This property has a
minimum value of 1.</td>
<td>1</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="div2">
<h3><a name="Timing_Properties" id="Timing_Properties" />8.3 Speech
and DTMF Input Timing Properties</h3>
<p>The various timing properties for speech and DTMF recognition
work together to define the user experience. The ways in which
these different timing parameters function are outlined in the
timing diagrams below. In these diagrams, the start for wait of
DTMF input, or user speech both occur at the time that the last
prompt has finished playing.</p>
<div class="div3">
<h4><a name="d3e9650" id="d3e9650" />8.3.1 DTMF Grammars</h4>
<p>DTMF grammars use timeout, interdigittimeout, termtimeout and
termchar as described in <a href="#Properties:DTMF"><b>8.2.2 DTMF
Recognition Properties</b></a> to tailor the user experience. The
effects of these are shown in the following timing diagrams.</p>
<div class="div4">
<h5><a name="timeout_No_Input_Provided"
id="timeout_No_Input_Provided" />8.3.1.1 timeout, No Input
Provided</h5>
<p>The timeout parameter determines when the <noinput> event
is thrown because the user has failed to enter any DTMF. Once the
first DTMF has been entered, this parameter has no further
effect.</p>
<p><img class="center" src="Images/dtmfTimeoutNoinput.gif"
alt="Timing diagram for timeout when no input provided" /></p>
<p class="caption">Figure 17: Timing diagram for timeout when no
input provided.</p>
</div>
<div class="div4">
<h5><a name="interdigittimeout_Grammar_is_Not_Ready_to_Terminate"
id="interdigittimeout_Grammar_is_Not_Ready_to_Terminate" />8.3.1.2
interdigittimeout, Grammar is Not Ready to Terminate</h5>
<p>In the following diagram, the interdigittimeout determines when
the nomatch event is thrown because a DTMF grammar is not yet
recognized, and the user has failed to enter additional DTMF.</p>
<p><img class="center" src="Images/dtmfIDTNotReady.gif"
alt="Timing diagram for interdigittimeout, grammar is not ready to terminate" /></p>
<p class="caption">Figure 18: Timing diagram for interdigittimeout,
grammar is not ready to terminate.</p>
</div>
<div class="div4">
<h5><a name="interdigittimeout_Grammar_is_Ready_to_Terminate"
id="interdigittimeout_Grammar_is_Ready_to_Terminate" />8.3.1.3
interdigittimeout, Grammar is Ready to Terminate</h5>
<p>The example below shows the situation when a DTMF grammar could
terminate, or extend by the addition of more DTMF input, and the
user has elected not to provide any further input.</p>
<p><img class="center" src="Images/dtmfIDTReady.gif"
alt="Timing diagram for interdigittimeout, grammar is ready to terminate" /></p>
<p class="caption">Figure 19: Timing diagram for interdigittimeout,
grammar is ready to terminate.</p>
</div>
<div class="div4">
<h5><a name="termchar_and_interdigittimeout_Grammar_Can_Terminate"
id="termchar_and_interdigittimeout_Grammar_Can_Terminate" />8.3.1.4
termchar and interdigittimeout, Grammar Can Terminate</h5>
<p>In the example below, a termchar is non-empty, and is entered by
the user before an interdigittimeout expires, to signify that the
users DTMF input is complete; the termchar is not included as part
of the recognized value.</p>
<p><img class="center" src="Images/dtmfIDTTermchar.gif"
alt="Timing diagram for termchar and interdigittimeout, grammar can terminate" /></p>
<p class="caption">Figure 20: Timing diagram for interdigittimeout,
Timing diagram for termchar and interdigittimeout, grammar can
terminate.</p>
</div>
<div class="div4">
<h5><a name="termchar_Empty_When_Grammar_Must_Terminate"
id="termchar_Empty_When_Grammar_Must_Terminate" />8.3.1.5 termchar
Empty When Grammar Must Terminate</h5>
<p>In the example below, the entry of the last DTMF has brought the
grammar to a termination point at which no additional DTMF is
expected. Since termchar is empty, there is no optional terminating
character permitted, thus the recognition ends and the recognized
value is returned.</p>
<p><img class="center" src="Images/dtmfMustTerminate1.gif"
alt="Timing diagram for termchar empty when grammar must terminate" /></p>
<p class="caption">Figure 21: Timing diagram for termchar empty
when grammar must terminate.</p>
</div>
<div class="div4">
<h5><a name="d3e9702" id="d3e9702" />8.3.1.6 termchar Non-Empty and
termtimeout When Grammar Must Terminate</h5>
<p>In the example below, the entry of the last DTMF has brought the
grammar to a termination point at which no additional DTMF is
allowed by the grammar. If the termchar is non-empty, then the user
can enter an optional termchar DTMF. If the user fails to enter
this optional DTMF within termtimeout, the recognition ends and the
recognized value is returned. If the termtimeout is 0s (the
default), then the recognized value is returned immediately after
the last DTMF allowed by the grammar, without waiting for the
optional termchar. Note: the termtimeout applies only when no
additional input is allowed by the grammar; otherwise, the
interdigittimeout applies.</p>
<p><img class="center" src="Images/dtmfMustTerminate2.gif"
alt="Timing diagram for termchar non-empty and termtimeout when grammar must terminate" /></p>
<p class="caption">Figure 22: Timing diagram for termchar non-empty
and termtimeout when grammar must terminate.</p>
</div>
<div class="div4">
<h5><a name="d3e9711" id="d3e9711" />8.3.1.7 termchar Non-Empty and
termtimeout When Grammar Must Terminate</h5>
<p>In this example, the entry of the last DTMF has brought the
grammar to a termination point at which no additional DTMF is
allowed by the grammar. Since the termchar is non-empty, the user
enters the optional termchar within termtimeout causing the
recognized value to be returned (excluding the termchar).</p>
<p><img class="center" src="Images/dtmfMustTerminate3.gif"
alt="Timing diagram for termchar non-empty when grammar must terminate" /></p>
<p class="caption">Figure 23: Timing diagram for termchar non-empty
when grammar must terminate.</p>
</div>
<div class="div4">
<h5><a name="Invalid_DTMF_Input" id="Invalid_DTMF_Input" />8.3.1.8
Invalid DTMF Input</h5>
<p>While waiting for the first or additional DTMF, three different
timeouts may determine when the user's input is considered
complete. If no DTMF has been entered, the timeout applies; if some
DTMF has been entered but additional DTMF is valid, then the
interdigittimeout applies; and if no additional DTMF is legal, then
the termtimeout applies. At each point, the user may enter DTMF
which is not permitted by the active grammar(s). This causes the
collected DTMF string to be invalid. Additional digits will be
collected until either the termchar is pressed or the
interdigittimeout has elapsed. A nomatch event is then
generated.</p>
</div>
</div>
<div class="div3">
<h4><a name="d3e9725" id="d3e9725" />8.3.2 Speech Grammars</h4>
<p>Speech grammars use timeout, completetimeout, and
incompletetimeout as described in <a
href="#Properties:PromptandCollect"><b>8.2.3 Prompt and Collect
Properties</b></a> and <a href="#Properties:ASR"><b>8.2.1 Speech
Recognition Properties</b></a> to tailor the user experience. The
effects of these are shown in the following timing diagrams.</p>
<div class="div4">
<h5><a name="timeout_When_No_Speech_Provided"
id="timeout_When_No_Speech_Provided" />8.3.2.1 timeout When No
Speech Provided</h5>
<p>In the example below, the timeout parameter determines when the
noinput event is thrown because the user has failed to speak.</p>
<p><img class="center" src="Images/speechNoinput.gif"
alt="Timing diagram for timeout when no speech provided" /></p>
<p class="caption">Figure 24: Timing diagram for timeout when no
speech provided.</p>
</div>
<div class="div4">
<h5><a name="completetimeout_With_Speech_Grammar_Recognized"
id="completetimeout_With_Speech_Grammar_Recognized" />8.3.2.2
completetimeout With Speech Grammar Recognized</h5>
<p>In the example above, the user provided a utterance that was
recognized by the speech grammar. After a silence period of
completetimeout has elapsed, the recognized value is returned.</p>
<p><img class="center" src="Images/speechRecognized.gif"
alt="Timing diagram for completetimeout with speech grammar recognized" /></p>
<p class="caption">Figure 25: Timing diagram for completetimeout
with speech grammar recognized.</p>
</div>
<div class="div4">
<h5><a name="incompletetimeout_with_Speech_Grammar_Unrecognized"
id="incompletetimeout_with_Speech_Grammar_Unrecognized" />8.3.2.3
incompletetimeout with Speech Grammar Unrecognized</h5>
<p>In the example above, the user provided a utterance that is not
as yet recognized by the speech grammar but is the prefix of a
legal utterance. After a silence period of incompletetimeout has
elapsed, a nomatch event is thrown.</p>
<p><img class="center" src="Images/speechUnrecognized.gif"
alt="Timing diagram for incompletetimeout with speech grammar unrecognized" /></p>
<p class="caption">Figure 26: Timing diagram for incompletetimeout
with speech grammar unrecognized.</p>
</div>
</div>
</div>
<div class="div2">
<h3><a name="ValueDesignations" id="ValueDesignations" />8.4 Value
Designations</h3>
<p>Several VoiceXML parameter values follow the conventions used in
the W3C's Cascading Style Sheet Recommendation <a
href="#">[CSS2]</a>.</p>
<div class="div3">
<h4><a name="IntegerDesignation" id="IntegerDesignation" />8.4.1
Integers</h4>
<p>Integers are specified in decimal notation only. Integers may be
preceded by a "-" or "+" to indicate the sign.</p>
<p>An integer consists of one or more digits "0" to "9".</p>
</div>
<div class="div3">
<h4><a name="RealNumberDesignation"
id="RealNumberDesignation" />8.4.2 Real Numbers</h4>
<p>Real numbers are specified in decimal notation only. Real
numbers may be preceded by a "-" or "+" to indicate the sign.</p>
<p>A real number may be an integer, or it may be zero or more
digits followed by a dot (.) followed by one or more digits.</p>
</div>
<div class="div3">
<h4><a name="TimeDesignation" id="TimeDesignation" />8.4.3
Times</h4>
<p>Time designations consist of a non-negative real number followed
by a time unit identifier. The time unit identifiers are:</p>
<ul>
<li>ms: milliseconds</li>
<li>s: seconds</li>
</ul>
<p>Examples include: "3s", "850ms", "0.7s", ".5s" and "+1.5s".</p>
</div>
</div>
</div>
<div class="div1">
<h2><a name="Integration" id="Integration" />9 Integration with
Other Markup Languages</h2>
<p>This section presents some initial thoughts on how VoiceXML
might be embedded within SCXML and how flow control languages such
as SCXML and CCXML might be integrated into VoiceXML.</p>
<div class="div2">
<h3><a name="Integration:WithinSCXML"
id="Integration:WithinSCXML" />9.1 Embedding of VoiceXML within
SCXML</h3>
<p>The following bank application example demonstrates how external
vxml application could be invoked by a scxml script and vice versa.
The state machine and flow control was implemented in the
BankApp.scxml. The call is started from the BankApp.scxml, it will
first call BankApp.vxml's form "getAccountNum" to collect the
account number, then query database for checking and saving
balance. The BankApp.scxml will then invoke the form "playBalance".
If this form finds the accountType is not defined, it will invoke
the AccountType.scxml, which will call BankApp.vxml form
"getAccountType" to get the accountType. The "playBalance" will
then play the balance on the corresponding account and return the
call back to the BankApp.scxml.</p>
<p>BankApp.scxml</p>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:my="http://scxml.example.org/" version="1.0" initial="getAccountNum" profile="ecmascript" >
<state id="getAccountNum">
<invoke targettype="vxml3" src="BankApp.vxml#getAccountNum" />
<transition event="vxml3.gotAccountNum" target="getBalance"/>
</state>
<state id="getBalance">
<datamodel>
<data name="method" expr="'getBalance'"/>
<data name="accountNum" expr="_data.accountNum"/>
</datamodel>
<send targettype="basichttp" target="BankDB.do" namelist="method accountNum" />
<transition event="basichttp.gotBalance" target="playingBalance"/>
</state>
<state id="playBalance">
<datamodel>
<data name="checking_balance" expr="_data.checking.balance" />
<data name="saving_balance" expr="_data.saving.balance" />
</datamodel>
<invoke targettype="vxml3" target="BankApp.vxml#playBalance" namelist="checking_balance saving_balance" />
<transition event="vxml3.playedBalance" target="exit" />
</state>
<final id="exit"/>
</scxml>
</pre>
</div>
<p>AccountType.scxml</p>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" xmlns:my="http://scxml.example.org/" version="1.0" initial="getAccountType" profile="ecmascript" >
<state id="getAccountType">
<invoke targettype="vxml3" src="BankApp.vxml#getAccountType" />
<transition event="vxml3.gotAccountType" target="exit"/>
</state>
<final id="exit"/>
</scxml>
</pre>
</div>
<p>BankApp.vxml</p>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<!-- TODO: need to add final namespace, schema, etc. for vxml element. -->
<vxml version="3.0">
<form id="getAccountNum">
<field name="accountNum">
<grammar src=“accountNum.grxml" type="application/grammar+xml"/>
<prompt>
Please tell me your account number.
</prompt>
<filled>
<exit namelist="accountNum"/>
</filled>
</field>
</form>
<form id="getAccountType">
<field name="accountType">
<grammar src=“accountType.grxml" type="application/grammar+xml"/>
<prompt>
Do you want the balance on checking or saving account?
</prompt>
<filled>
<exit namelist="accountType"/>
</filled>
</field>
</form>
<form id="playBalance">
<var name="checking_balance"/>
<var name="saving_balance"/>
<block>
<if cond="accountType == undefined">
<!--Here we are trying to invoke the external scxml script. At the time this example is written,
the syntax to do this has not yet been decided. -->
<goto next="AccountType.scxml#getAccountType"/>
</if>
<if cond="accountType == 'checking'">
<prompt>
The checking account balance is <value expr="checking_balance"/>.
</prompt>
<else>
<prompt>
The saving account balance is <value expr="saving_balance"/>.
</prompt>
</if>
</block>
</form>
</vxml>
</pre>
</div>
</div>
<div class="div2">
<h3><a name="Integration:InsideVoiceXML"
id="Integration:InsideVoiceXML" />9.2 Integrating Flow Control
Languages into VoiceXML</h3>
<p>State Chart XML (SCXML) could be used as the controller for
managing the dialog in VoiceXML 3.0 applications. A recursive MVC
technique allows SCXML controllers to be placed at session,
document and form levels. Examples of resulting compound documents
(containing V3 and SCXML namespaced elements) appear below for
illustration. A graceful degradation / fallback approach could be
used to ensure backwards compatibility with V2 applications. Note
that the examples below use a new v3:scxmlform element.</p>
<p>[ISSUE: It has been suggested that using the existing v3:form
element instead of a new v3:scxmlform element would be simpler and
more elegant. Although the working group currently knows of no
particular reason why the existing v3:form couldn't be used instead
of a new v3:scxmlform element, the group has not yet discussed this
in detail or agreed that using v3:form in this way is desirable.
The group plans to discuss this and is interested in receiving
public feedback on this possibility.]</p>
<div class="div3">
<h4><a name="Integration:InsideVoiceXML:SCXMLForDialog"
id="Integration:InsideVoiceXML:SCXMLForDialog" />9.2.1 SCXML for
Dialog Management</h4>
<p>Example application scenario:</p>
<ul>
<li>This is an airline travel itinerary modification
application</li>
<li>First order of business is to retrieve an itinerary to be
modified</li>
<li>Itinerary may be identified using either a record locator or
traveler's lastname and other information</li>
</ul>
<p>Below are two flavors of this application using SCXML as the
form-level controller, a system-driven and a user-driven approach.
These use similar set of fields in the form but different dialog
management styles. In the simpler example here, the VUI might
appear similar though there is a system vs. user driven flavor.</p>
<div class="div4">
<h5><a
name="Integration:InsideVoiceXML:SCXMLForDialog:SystemDriven"
id="Integration:InsideVoiceXML:SCXMLForDialog:SystemDriven" />9.2.1.1
System-driven Dialog</h5>
<ul>
<li>Starts off by asking if the record locator is available</li>
<li>If the locator is available, it's requested</li>
<li>If the locator isn't available, the last name and some other
pieces of information are requested to uniquely identify the
itinerary</li>
<li>Once the itinerary is identified, we proceed with application
functions</li>
</ul>
<p>Consider the following sketch of a V3 form for this purpose:</p>
<div class="exampleInner">
<pre>
<v3:scxmlform>
<scxml:scxml initial="choice">
<scxml:state id="choice">
<scxml:invoke type="vxml3field" src="#choicefield"/>
<scxml:transition event="filled.choice" cond="choicefield"
target="locator"/>
<scxml:transition event="filled.choice" cond="!choicefield"
target="lastname"/>
</scxml:state>
<scxml:state id="locator">
<scxml:invoke type="vxml3field" src="#locatorfield"/>
<!-- Retrieve record, transition to app menu -->
</scxml:state>
<scxml:state id="lastname">
<scxml:invoke type="vxml3field" src="#lastnamefield"/>
<!-- Collect other information needed to retrieve record,
then retrieve record and go to app menu -->
</scxml:state>
<!-- Remaining dialog control flow logic omitted -->
</scxml:scxml>
<v3:field name="choicefield">
<v3:grammar src="boolean.grxml" type="application/srgs+xml"/>
<v3:prompt>
Welcome. Do you have the record locator for your itinerary?
<v3:prompt>
<v3:filled>
<v3:throw event="filled.choice"/>
</v3:filled>
</v3:field>
<v3:field name="locatorfield">
<v3:grammar src="locator.grxml" type="application/srgs+xml"/>
<v3:prompt>
What is the record locator for the itinerary?
<v3:prompt>
<v3:filled>
<v3:throw event="filled.locator"/>
</v3:filled>
</v3:field>
<v3:field name="lastnamefield">
<v3:grammar src="lastname.grxml" type="application/srgs+xml"/>
<v3:prompt>
Please say or spell your last name.
<v3:prompt>
<v3:filled>
<v3:throw event="filled.lastname"/>
</v3:filled>
</v3:field>
<!-- Other form items, such as the subsequent application menu omitted
-->
</v3:scxmlform>
</pre>
</div>
</div>
<div class="div4">
<h5><a name="Integration:InsideVoiceXML:SCXMLForDialog:UserDriven"
id="Integration:InsideVoiceXML:SCXMLForDialog:UserDriven" />9.2.1.2
User-driven Dialog</h5>
<ul>
<li>Starts off by asking what information the user would like to
supply to identify the itinerary</li>
<li>If the user indicates the record locator will be provided, it's
retrieved</li>
<li>If the user indicates the last name will be provided, it's
retrieved (some other pieces of information may be retrieved to
uniquely identify the itinerary)</li>
<li>Once the itinerary is identified, we proceed with application
functions</li>
</ul>
<p>Consider the following sketch of a V3 form for this purpose:</p>
<div class="exampleInner">
<pre>
<v3:scxmlform>
<scxml:scxml initial="choice">
<scxml:state id="choice">
<scxml:invoke type="vxml3field" src="#choicefield"/>
<scxml:transition event="filled.choice" cond="choicefield == 'locator'"
target="locator"/>
<scxml:transition event="filled.choice" cond="choicefield == 'lastname'"
target="lastname"/>
</scxml:state>
<scxml:state id="locator">
<scxml:invoke type="vxml3field" src="#locatorfield"/>
<!-- Retrieve record, transition to app menu -->
</scxml:state>
<scxml:state id="lastname">
<scxml:invoke type="vxml3field" src="#lastnamefield"/>
<!-- Collect other information needed to retrieve record,
then retrieve record and go to app menu -->
</scxml:state>
<!-- Remaining dialog control flow logic omitted -->
</scxml:scxml>
<v3:field name="choicefield">
<v3:grammar src="choice.grxml" type="application/srgs+xml"/>
<v3:prompt>
Welcome. How would you like to look up your itinerary?
<v3:prompt>
<v3:filled>
<v3:throw event="filled.choice"/>
</v3:filled>
</v3:field>
<v3:field name="locatorfield">
<v3:grammar src="locator.grxml" type="application/srgs+xml"/>
<v3:prompt>
What is the record locator for the itinerary?
<v3:prompt>
<v3:filled>
<v3:throw event="filled.locator"/>
</v3:filled>
</v3:field>
<v3:field name="lastnamefield">
<v3:grammar src="lastname.grxml" type="application/srgs+xml"/>
<v3:prompt>
Please say or spell your last name.
<v3:prompt>
<v3:filled>
<v3:throw event="filled.lastname"/>
</v3:filled>
</v3:field>
<!-- Other form items, such as the subsequent application menu omitted
-->
</v3:scxmlform>
</pre>
</div>
</div>
</div>
<div class="div3">
<h4><a name="Integration:InsideVoiceXML:GracefulDegradation"
id="Integration:InsideVoiceXML:GracefulDegradation" />9.2.2
Graceful Degradation</h4>
<p>One possibility with this approach is that the absence of an
<scxml:scxml> child element in a <v3:scxmlform> could
revert behavior to be identical to a <v2:form> element where
the V2 Form Interpretation Algorithm would be in charge. In the
presence of a <scxml:scxml> child, the FIA would be
suppressed and the more expressive SCXML controller used, which
would allow application developers to design the form VUI in a very
flexible manner. In other words, the following <v3:scxmlform>
below:</p>
<div class="exampleInner">
<pre>
<v3:scxmlform>
<!-- No SCXML child -->
<!-- Various form items etc. -->
</v3:scxmlform>
</pre>
</div>
<p>behaves as would:</p>
<div class="exampleInner">
<pre>
<v2:form>
<!-- Various form items etc. -->
</v2:form>
</pre>
</div>
</div>
<div class="div3">
<h4><a name="Integration:InsideVoiceXML:RecursiveMVC"
id="Integration:InsideVoiceXML:RecursiveMVC" />9.2.3 SCXML as Basis
for Recursive MVC</h4>
<p>The above example illustrated a form-level SCXML controller.
SCXML could perhaps also be used as a document level controller,
where it would be managing the interaction across v3:forms, rather
than v3:fields. To illustrate:</p>
<div class="exampleInner">
<pre>
<v3:vxml>
<scxml:scxml ...>
<!-- document level controller managing interaction
across form1, form2 and form3 -->
</scxml:scxml>
<v3:form id="form1">
<!-- form1 content, might also have a form level SCXML controller -->
</v3:form>
<v3:form id="form2">
<!-- form2 content, might also have a form level SCXML controller -->
</v3:form>
<v3:form id="form3">
<!-- form3 content, might also have a form level SCXML controller -->
</v3:form>
</v3:vxml>
</pre>
</div>
</div>
</div>
</div>
</div>
<div class="back">
<div class="div1">
<h2><a name="Acknowledgements" id="Acknowledgements" />A
Acknowledgements</h2>
<p>This version of VoiceXML was written with the participation of
members of the W3C Voice Browser Working Group. The work of the
following members has significantly facilitated the development of
this specification:</p>
<ul>
<li>Emily Bateman, Comverse</li>
<li>Skip Cave, Intervoice</li>
<li>Andrew Fuller, VoxPilot</li>
<li>Jeff Hoepfinger, Sandcherry</li>
<li>Jim Larson, Intervoice</li>
<li>Lakshmi Krishnamurthy, Genesys</li>
<li>Satya Palivela, Intervoice</li>
<li>Joseph Wong, Genesys</li>
</ul>
<p>The W3C Voice Browser Working Group would like to thank the W3C
team, especially Kazuyuki Ashimura and Matt Womer, for their
invaluable administrative and technical support.</p>
</div>
<div class="div1">
<h2><a name="References" id="References" />B References</h2>
<div class="div2">
<h3><a name="d3e9925" id="d3e9925" />B.1 Normative References</h3>
<dl>
<dt class="label"><a name="DFP_Framework"
id="DFP_Framework" />DFP</dt>
<dd><a href="http://www.w3.org/Voice/2006/DFP"><cite>The Voice
Browser DFP Framework</cite></a> W3C Informative Note, February
2006. (See http://www.w3.org/Voice/2006/DFP.)</dd>
<dt class="label"><a name="MMI" id="MMI" />MMI</dt>
<dd><a
href="http://www.w3.org/TR/2009/WD-mmi-arch-20091201/"><cite>Multimodal
Architecture and Interfaces</cite></a> W3C Working Draft, December
2009. (See http://www.w3.org/TR/2009/WD-mmi-arch-20091201/.)</dd>
<dt class="label"><a name="DOM3Events"
id="DOM3Events" />DOM3Events</dt>
<dd><a
href="http://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/"><cite>
Document Object Model (DOM) Level 3 Events Specification</cite></a>
Schepers, Höhrmann, Le Hégaret and Pixley. W3C Working Draft,
September 2009. (See
http://www.w3.org/TR/2009/WD-DOM-Level-3-Events-20090908/.)</dd>
<dt class="label"><a name="RFC2119" id="RFC2119" />RFC2119</dt>
<dd><a href="http://www.ietf.org/rfc/rfc2119.txt"><cite>Key words
for use in RFCs to Indicate Requirement Levels</cite></a> IETF RFC
2119, 1997. (See http://www.ietf.org/rfc/rfc2119.txt.)</dd>
<dt class="label"><a name="ECMASCRIPT"
id="ECMASCRIPT" />ECMASCRIPT</dt>
<dd><a
href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">
<cite>Standard ECMA-262 ECMAScript Language
Specification</cite></a>, Standard ECMA-262, December 1999. (See
http://www.ecma-international.org/publications/standards/Ecma-262.htm.)</dd>
<dt class="label"><a name="VOICEXML20"
id="VOICEXML20" />VOICEXML20</dt>
<dd><a href="http://www.w3.org/TR/voicexml20/"><cite>Voice
Extensible Markup Language (VoiceXML) Version 2.0</cite></a>
McGlashan et al. W3C Recommendation, March 2004. (See
http://www.w3.org/TR/voicexml20/.)</dd>
<dt class="label"><a name="VOICEXML21"
id="VOICEXML21" />VOICEXML21</dt>
<dd><a href="http://www.w3.org/TR/voicexml21/"><cite>Voice
Extensible Markup Language (VoiceXML) Version 2.1</cite></a> Oshry
et al. W3C Recommendation, May 2007. (See
http://www.w3.org/TR/voicexml21/.)</dd>
<dt class="label"><a name="SSML" id="SSML" />SSML</dt>
<dd><a href="http://www.w3.org/TR/speech-synthesis11/"><cite>Speech
Synthesis Markup Language Version 1.1</cite></a> Burnett and
Shuang. W3C Recommendation, September 2010. (See
http://www.w3.org/TR/speech-synthesis11/.)</dd>
<dt class="label"><a name="SRGS" id="SRGS" />SRGS</dt>
<dd><a href="http://www.w3.org/TR/speech-grammar/"><cite>Speech
Recognition Grammar Specification Version 1.0</cite></a> Hunt and
McGlashan. W3C Recommendation, March 2004. (See
http://www.w3.org/TR/speech-grammar/.)</dd>
<dt class="label"><a name="RFC2616" id="RFC2616" />RFC2616</dt>
<dd><a href="http://www.ietf.org/rfc/rfc2616.txt"><cite>Hypertext
Transfer Protocol -- HTTP/1.1</cite></a> IETF RFC 2616, 1999. (See
http://www.ietf.org/rfc/rfc2616.txt.)</dd>
<dt class="label"><a name="RFC2396" id="RFC2396" />RFC2396</dt>
<dd><a href="http://www.ietf.org/rfc/rfc2396.txt"><cite>Uniform
Resource Identifiers (URI): Generic Syntax</cite></a> IETF RFC
2396, 1998. (See http://www.ietf.org/rfc/rfc2396.txt.)</dd>
<dt class="label"><a name="BCP47" id="BCP47" />BCP47</dt>
<dd><a href="http://www.rfc-editor.org/bcp/bcp47.txt"><cite>Tags
for Identifying Languages and Matching of Language Tags</cite></a>
A. Phillips and M. Davis, Editors. IETF, September 2009. (See
http://www.rfc-editor.org/bcp/bcp47.txt.)</dd>
</dl>
</div>
<div class="div2">
<h3><a name="d3e9988" id="d3e9988" />B.2 Informative
References</h3>
</div>
</div>
<div class="div1">
<h2><a name="Glossary_of_Terms" id="Glossary_of_Terms" />C Glossary
of Terms</h2>
<dl>
<dt class="label">active grammar</dt>
<dd>A speech or DTMF grammar that is currently active. This is
based on the currently executing element, and the scope elements of
the currently defined grammars.</dd>
<dt class="label">application</dt>
<dd>A collection of <em>VoiceXML documents</em> that are tagged
with the same application name attribute.</dd>
<dt class="label">ASR</dt>
<dd>Automatic speech recognition.</dd>
<dt class="label">author</dt>
<dd>The creator of a <em>VoiceXML document.</em></dd>
<dt class="label">catch element</dt>
<dd>A <catch> block or one of its abbreviated forms. Certain
default catch elements are defined by the <em>VoiceXML
interpreter</em>.</dd>
<dt class="label">control item</dt>
<dd>A <em>form item</em> whose purpose is either to contain a block
of procedural logics (<block>) or to allow initial prompts
for a mixed initiative dialog (<initial>).</dd>
<dt class="label">CSS W3C Cascading Style Sheet specification.</dt>
<dd>See <a href="#">[CSS2]</a></dd>
<dt class="label">dialog</dt>
<dd>An interaction with the user specified in a <em>VoiceXML
document</em>. Types of dialogs include <em>forms</em> and
<em>menus</em>.</dd>
<dt class="label">DTMF (Dual Tone Multi-Frequency)</dt>
<dd>Touch-tone or push-button dialing. Pushing a button on a
telephone keypad generates a sound that is a combination of two
tones, one high frequency and the other low frequency.</dd>
<dt class="label">ECMAScript</dt>
<dd>A standard version of JavaScript backed by the European
Computer Manufacturer's Association. See <a
href="#ECMASCRIPT">[ECMASCRIPT]</a></dd>
<dt class="label">event</dt>
<dd>A notification "thrown" by the <em>implementation
platform</em>, <em>VoiceXML interpreter context</em>, <em>VoiceXML
interpreter</em>, or VoiceXML code. Events include exceptional
conditions (semantic errors), normal errors (user did not say
something recognizable), normal events (user wants to exit), and
user defined events.</dd>
<dt class="label">executable content</dt>
<dd>Procedural logic that occurs in <block>, <filled>,
and <em>event handlers</em>.</dd>
<dt class="label">form</dt>
<dd>A <em>dialog</em> that interacts with the <em>user</em> in a
highly flexible fashion with the computer and the <em>user</em>
sharing the initiative.</dd>
<dt class="label">FIA (Form Interpretation Algorithm)</dt>
<dd>An algorithm implemented in a <em>VoiceXML interpreter</em>
which drives the interaction between the user and a VoiceXML form
or menu. See vxml2: Section 2.1.6, vxml2: Appendix C.</dd>
<dt class="label">form item</dt>
<dd>An element of <form> that can be visited during form
execution: <initial>, <block>, <field>,
<record>, <object>, <subdialog>, and
<transfer>.</dd>
<dt class="label">form item variable</dt>
<dd>A variable, either implicitly or explicitly defined, associated
with each <em>form item</em> in a <em>form</em>. If the form item
variable is undefined, the form interpretation algorithm will visit
the form item and use it to interact with the user.</dd>
<dt class="label">implementation platform</dt>
<dd>A computer with the requisite software and/or hardware to
support the types of interaction defined by VoiceXML.</dd>
<dt class="label">input item</dt>
<dd>A <em>form item</em> whose purpose is to input a input item
variable. Input items include <field>, <record>,
<object>, <subdialog>, and <transfer>.</dd>
<dt class="label">[<a name="term-language" id="term-language"
title="language identifier">Definition</a>: language
identifier]</dt>
<dd>A language identifier labels information content as being of a
particular human language variant. Following the XML specification
for language identification <a href="#">[XML]</a>, a legal language
identifier is identified by BCP 47 <a
href="#BCP47">[BCP47]</a>.</dd>
<dt class="label">link</dt>
<dd>A set of grammars that when matched by something the
<em>user</em> says or keys in, either transitions to a new dialog
or document or throws an event in the current form item.</dd>
<dt class="label">menu</dt>
<dd>A <em>dialog</em> presenting the <em>user</em> with a set of
choices and takes action on the selected one.</dd>
<dt class="label">mixed initiative</dt>
<dd>A computer-human interaction in which either the computer or
the human can take initiative and decide what to do next.</dd>
<dt class="label">JSGF</dt>
<dd>Java API Speech Grammar Format. A proposed standard for
representing speech grammars. See <a href="#">[JSGF]</a></dd>
<dt class="label">object</dt>
<dd>A platform-specific capability with an interface available via
VoiceXML.</dd>
<dt class="label">request</dt>
<dd>A collection of data including: a URI specifying a document
server for the data, a set of name-value pairs of data to be
processed (optional), and a method of submission for processing
(optional).</dd>
<dt class="label">script</dt>
<dd>A fragment of logic written in a client-side scripting
language, especially <em>ECMAScript</em>, which is a scripting
language that must be supported by any <em>VoiceXML
interpreter</em>.</dd>
<dt class="label">session</dt>
<dd>A connection between a <em>user</em> and an <em>implementation
platform</em>, e.g. a telephone call to a voice response system.
One session may involve the interpretation of more than one
<em>VoiceXML document</em>.</dd>
<dt class="label">SRGS (Speech Recognition Grammar
Specification)</dt>
<dd>A standard format for context-free speech recognition grammars
being developed by the W3C Voice Browser group. Both ABNF and XML
formats are defined <a href="#SRGS">[SRGS]</a>.</dd>
<dt class="label">SSML (Speech Synthesis Markup Language)</dt>
<dd>A standard format for speech synthesis being developed by the
W3C Voice Browser group <a href="#SSML">[SSML]</a>.</dd>
<dt class="label">subdialog</dt>
<dd>A VoiceXML dialog (or document) invoked from the current
<em>dialog</em> in a manner analogous to function calls.</dd>
<dt class="label">tapered prompts</dt>
<dd>A set of prompts used to vary a message given to the human.
Prompts may be tapered to be more terse with use (field prompting),
or more explicit (help prompts).</dd>
<dt class="label">throw</dt>
<dd>An element that fires an <em>event</em>.</dd>
<dt class="label">TTS</dt>
<dd>text-to-speech; speech synthesis.</dd>
<dt class="label">user</dt>
<dd>A person whose interaction with an <em>implementation
platform</em> is controlled by a <em>VoiceXML
interpreter</em>.</dd>
<dt class="label">URI</dt>
<dd>Uniform Resource Indicator.</dd>
<dt class="label">URL</dt>
<dd>Uniform Resource Locator.</dd>
<dt class="label">VoiceXML document</dt>
<dd>An XML document conforming to the VoiceXML specification.</dd>
<dt class="label">VoiceXML interpreter</dt>
<dd>A computer program that interprets a <em>VoiceXML document</em>
to control an <em>implementation platform</em> for the purpose of
conducting an interaction with a <em>user.</em></dd>
<dt class="label">VoiceXML interpreter context</dt>
<dd>A computer program that uses a <em>VoiceXML interpreter</em> to
interpret a <em>VoiceXML Document</em> and that may also interact
with the <em>implementation platform</em> independently of the
<em>VoiceXML interpreter</em>.</dd>
<dt class="label">W3C</dt>
<dd>World Wide Web Consortium <a
href="http://www.w3.org/">http://www.w3.org/</a></dd>
</dl>
</div>
<div class="div1">
<h2><a name="Schema" id="Schema" />D VoiceXML 3.0 XML Schema</h2>
<div class="div2">
<h3><a name="Schema:Root" id="Schema:Root" />D.1 Schema for VXML
Root Module</h3>
</div>
<div class="div2">
<h3><a name="Schema:Form" id="Schema:Form" />D.2 Schema for Form
Module</h3>
</div>
<div class="div2">
<h3><a name="Schema:Field" id="Schema:Field" />D.3 Schema for Field
Module</h3>
</div>
<div class="div2">
<h3><a name="Schema:Prompt" id="Schema:Prompt" />D.4 Schema for
Prompt Module</h3>
</div>
<div class="div2">
<h3><a name="Schema:BuiltinSSML" id="Schema:BuiltinSSML" />D.5
Schema for Builtin SSML Module</h3>
</div>
<div class="div2">
<h3><a name="Schema:Foreach" id="Schema:Foreach" />D.6 Schema for
Foreach Module</h3>
</div>
<div class="div2">
<h3><a name="Schema:Data" id="Schema:Data" />D.7 Schema for Data
Access and Manipulation Module</h3>
</div>
<div class="div2">
<h3><a name="Schema:Legacy" id="Schema:Legacy" />D.8 Schema for
Legacy Profile</h3>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="TBD"
targetNamespace="TBD" blockDefault="#all">
<xsd:annotation>
<xsd:documentation>
This is the XML Schema driver for Legacy Profile of Vxml 3.0 specification.
Please use this namespace for the Legacy Profile:
"TBD:URL to schema"
</xsd:documentation>
<xsd:documentation source="vxml3-copyright.xsd"/>
</xsd:annotation>
<xsd:annotation>
<xsd:documentation>
This is the Schema Driver file for Legacy Profile of Vxml 3.0 Specification
This schema
+ sets the namespace for Legacy Profile of Vxml 3.0 Specification
+ imports external schemas (xml.xsd)
+ imports schema modules
Legacy Profile includes the following Modules
* Vxml Root module
* Form module
* Field module
* Prompt module
* Grammar module
* Data Access and Manipulation Module
</xsd:documentation>
</xsd:annotation>
<xsd:import namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="http://www.w3.org/2001/xml.xsd">
<xsd:annotation>
<xsd:documentation>
This import brings in the XML namespace attributes
The XML attributes are used by various modules.
</xsd:documentation>
</xsd:annotation>
</xsd:import>
<xsd:include schemaLocation="vxml-datatypes.xsd">
<xsd:annotation>
<xsd:documentation>
This imports brings in the common datatypes for Vxml.
</xsd:documentation>
</xsd:annotation>
</xsd:include>
<xsd:include schemaLocation="vxml-attribs.xsd">
<xsd:annotation>
<xsd:documentation>
This imports brings in the common attributes for Vxml.
</xsd:documentation>
</xsd:annotation>
</xsd:include>
<xsd:include schemaLocation="vxml3-module-vxmlroot.xsd">
<xsd:annotation>
<xsd:documentation>
This imports the Vxml Root module for Vxml 3.0
</xsd:documentation>
</xsd:annotation>
</xsd:include>
<xsd:include schemaLocation="vxml3-module-form.xsd">
<xsd:annotation>
<xsd:documentation>
This imports the Form module for Vxml 3.0
</xsd:documentation>
</xsd:annotation>
</xsd:include>
<xsd:include schemaLocation="vxml3-module-field.xsd">
<xsd:annotation>
<xsd:documentation>
This imports the Field module for Vxml 3.0
</xsd:documentation>
</xsd:annotation>
</xsd:include>
<xsd:include schemaLocation="vxml3-module-prompt.xsd">
<xsd:annotation>
<xsd:documentation>
This imports the Prompt module for Vxml 3.0
</xsd:documentation>
</xsd:annotation>
</xsd:include>
<xsd:include schemaLocation="vxml3-module-grammar.xsd">
<xsd:annotation>
<xsd:documentation>
This imports the Grammar module for Vxml 3.0
</xsd:documentation>
</xsd:annotation>
</xsd:include>
<xsd:include schemaLocation="vxml3-module-dataacces.xsd">
<xsd:annotation>
<xsd:documentation>
This imports the Data Access and Manipulation module for Vxml 3.0
</xsd:documentation>
</xsd:annotation>
</xsd:include>
</xsd:schema>
</pre>
</div>
<table border="1" summary="Editorial note">
<tr>
<td align="left" valign="top" width="50%"><b>Editorial
note</b></td>
<td align="right" valign="top" width="50%"> </td>
</tr>
<tr>
<td colspan="2" align="left" valign="top">The schema is incomplete.
It merely imports the schemas for various modules, but doesn't
contain parent/child relationships between modules or constraints
on them. These all need to be specified in the future.</td>
</tr>
</table>
</div>
</div>
<div class="div1">
<h2><a name="V2Convenience" id="V2Convenience" />E Convenience
Syntax in VoiceXML 2.x</h2>
<p>VoiceXML 2 defines shorthand notation for several fundamental
capabilities. For example, some <catch> elements can be
represented in a shortened form:</p>
<div class="exampleInner">
<pre>
<noinput>I didn’t hear anything. </noinput>
</pre>
</div>
<p>is equivalent to:</p>
<div class="exampleInner">
<pre>
<catch event="noinput"> I didn’t hear anything. </catch>
</pre>
</div>
<p>This notation could be transformed via standard text
substitution tools.</p>
<div class="div2">
<h3><a name="V2Convenience:SimplifiedDialogs"
id="V2Convenience:SimplifiedDialogs" />E.1 Simplified Dialog
Structure</h3>
<p>In addition to the fundamental <form> / <field> /
<grammar> structure, VoiceXML 2 defines several simplified
dialog specification mechanisms. These "syntactic shorthand"
representations make it easier to build some types of dialogs.</p>
<p>For example, <menu> provides a means of allowing a user to
select from a short list of items. The syntactic notation provides
several shortcuts:</p>
<ul>
<li>a <choice> element that combines input definition (ASR
and/or DTMF) with route selection (where to go next)</li>
<li>automatic speech grammar generation from an individual word or
phrase per individual choice</li>
<li>DTMF specification per individual choice</li>
<li>automated prompt generation (via <enumerate>)</li>
</ul>
<p>Another shorthand notation uses the standard <form> and
<field> but simplifies the specification of a speech grammar
through the <option> element. It isn’t necessary for a
developer to understand SRGS in order to specify a phrase and
associated semantic return value.</p>
</div>
<div class="div2">
<h3><a name="V2Convenience:Examples"
id="V2Convenience:Examples" />E.2 Examples</h3>
<p>The following examples demonstrate the different V2 syntactic
mechanisms that provide identical functionality.</p>
<div class="div3">
<h4><a name="V2Convenience:MenuWithChoice"
id="V2Convenience:MenuWithChoice" />E.2.1 <menu> with
<choice></h4>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" …>
<menu dtmf="true">
<prompt>
Say one of: <enumerate/>
</prompt>
<!-- DTMF choices are automatically generated since dtmf="true" is --
-- set,
except where explicitly specified.
-->
<choice dtmf="0" next="#operator"> operator </choice>
<choice next="http://sports.example.com/start.vxml">
sports </choice>
<choice next="http://weather.example.com/intro.vxml">
weather </choice>
<choice next="http://news.example.com/news.vxml"> news </choice>
</menu>
</vxml>
</pre>
</div>
</div>
<div class="div3">
<h4><a name="V2Convenience:EquivFormFieldOption"
id="V2Convenience:EquivFormFieldOption" />E.2.2 Equivalent
<form>, <field>, <option></h4>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" …>
<form id="get_choice">
<!-- Link emulates ‘operator’ choice in menu -->
<link next="#operator"/>
<grammar mode="voice" version="1.0" root="root">
<rule id="root" scope="public"> operator </rule>
</grammar>
<grammar mode="dtmf" version="1.0" root="root2">
<rule id="root2" scope="public"> 0 </rule>
</grammar>
</link>
<field name="choice">
<prompt>
Say one of: <enumerate/>
</prompt>
<option dtmf="1" value="sports"> sports </option>
<option dtmf="2" value="weather"> weather </option>
<option dtmf="3" value="news"> news </option>
<filled>
<if cond="choice == 'sports'">
<goto next="http://sports.example.com/start.vxml"/>
<elseif cond="choice == 'weather'"/>
<goto next="http://weather.example.com/intro.vxml"/>
<elseif cond="choice == 'news'"/>
<goto next="http://news.example.com/news.vxml"/>
<else/>
</if>
</filled>
</field>
</form>
</vxml>
</pre>
</div>
</div>
<div class="div3">
<h4><a name="V2Convenience:EquivFormFieldGrammar"
id="V2Convenience:EquivFormFieldGrammar" />E.2.3 Equivalent
<form>, <field>, <grammar></h4>
<div class="exampleInner">
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<vxml version="2.0" …>
<form id="get_choice">
<!-- Link emulates ‘operator’ choice in menu -->
<link next="#operator"/>
<grammar mode="voice" version="1.0" root="root">
<rule id="root" scope="public"> operator </rule>
</grammar>
<grammar mode="dtmf" version="1.0" root="root2">
<rule id="root2" scope="public"> 0 </rule>
</grammar>
</link>
<field name="choice">
<prompt>
Say one of sports, weather, news.
</prompt>
<grammar mode="voice" version="1.0" root="root">
<rule id="root" scope="public">
<one-of>
<item> sports </item>
<item> weather </item>
<item> news </item>
</one-of>
</rule>
</grammar>
<grammar mode="dtmf" version="1.0" root="root2">
<rule id="root2" scope="public">
<one-of>
<item> 1 </item>
<item> 2 </item>
<item> 3 </item>
</one-of>
</rule>
</grammar>
<filled>
<if cond="choice == '1' || 'sports'">
<goto next="http://sports.example.com/start.vxml"/>
<elseif cond="choice == '2' || 'weather'"/>
<goto next="http://weather.example.com/intro.vxml"/>
<elseif cond="choice == '3' || 'news'"/>
<goto next="http://news.example.com/news.vxml"/>
<else/>
</if>
</filled>
</field>
</form>
</vxml>
</pre>
</div>
</div>
</div>
</div>
<div class="div1">
<h2><a name="Changes" id="Changes" />F Major changes since the last
Working Draft</h2>
<ul>
<li>In Section 8.2.5 replaced fetchtimeout with {audio, document,
grammar, object, script}fetchtimeout.</li>
<li>Many, many editorial changes, including the removal of many
out-of-date editorial notes</li>
<li>In section 6.5.2 adjusted text to allow for SSML documents
containing extensions.</li>
<li>In section 6.6.1.1 added fetching attributes by reference to
section 8.1. Also updated all other uses of these attributes to
point to section 8.1.</li>
<li>Added media fetch properties into section 8.2.5.</li>
<li>Removed <media> as a child of <property> in section
6.6.1.</li>
</ul>
</div>
</div>
</body>
</html>