01 <html xmlns:salt="http://www.saltforum.org/2002/SALT">

02      <!-- Example electronic form (user directed) -->
03      <!-- © 2004 by Larson Technical Services -->

04 <head>
05      <!-- SALT Add-in to Internet Explorer object -->
06      <object id="SpeechTags"
07           CLASSID="clsid:33cbfc53-a7de-491a-90f3-0e782a7e347a"
08           VIEWASTEXT>
09      </object>

10 <!-- salt: Importing the namespace for the implementation -->
11      <?import namespace="salt" implementation="#SpeechTags" />
12 </head>
13 <body onload="intro.start();">
14 <!-- HTML form -->
15 <form id="Form1">

          Travel Reservation Application <br/>Click and speak </br>
          Departure City
16      <input id="iptFromCity" type = "text" onFocus="askFromCity.start();" /><br/>
          Destination City
17      <input id="iptToCity" type = "text" onFocus="askToCity.start();" /> <br/>
          <button type="button" name="Done" onclick="goodbye.start();">
               Done
          </button>
          <input type="reset" value="Reset" />
18 </form>

19 <!-- SPEECH OUTPUT -->

20 <salt:prompt id="intro">
21      Hello, welcome the Travel Reservation Application
22 </salt:prompt>

23 <salt:prompt id="askFromCity" onComplete = "lsnFromCity.start();">
24      Where do you want to travel from?
25 </salt:prompt>

26 <salt:prompt id="askToCity" onComplete = "lsnToCity.start();">
27      Where do you want to travel to?
28 </salt:prompt>

 

29 <salt:prompt id="goodbye">
30      You chose to travel from
31      <salt:value targetelement = "iptFromCity" targetattribute = "value"/>
32      to <salt:value targetelement = "iptToCity" targetattribute = "value"/>.
33      Your transaction has been submitted
34 </salt:prompt>

35 <salt:prompt id="progressiveHelpToCity" onComplete = "lsnToCity.start();">
36      Do want to travel to New York, Chicago, or San Francisco?
37 </salt:prompt>

38 <salt:prompt id="progressiveHelpFromCity" onComplete = ‘lsnFromCity.start();’>
39      Do you want to travel from New York, Chicago, or San Francisco?
40 </salt:prompt>

41 <salt:listen id="lsnFromCity"
42           onnoreco = "progressiveHelpFromCity.start();"
43           onsilence = "progressiveHelpFromCity.start();">
44      <salt:grammar id="gram1" name="gram1">
45           <grammar version="1.0" xml:lang="en-US"
46                        xmlns="http://www.w3.org/2001/06/grammar" root="FromCity">
47                <rule id="FromCity" scope="public">
48                     <one-of>
49                          <item> New York</item>
50                          <item> Chicago</item>
51                          <item> San Francisco</item>
52                    </one-of>
53               </rule>
54          </grammar>
55      </salt:grammar>
56      <salt:bind targetelement = "iptFromCity" value="//"/>
57 </salt:listen>

58 <salt:listen id="lsnToCity"
59           onnoreco = "progressiveHelpToCity.start();"
60           onsilence = "progressiveHelpToCity.start();">
61      <salt:grammar id="gram2" name="gram2">
62           <grammar version="1.0" xml:lang="en-US"
63                     xmlns="http://www.w3.org/2001/06/grammar" root="ToCity">
64                <rule id="ToCity" scope="public">
65                     <one-of>
66                          <item> New York</item>
67                          <item> Chicago</item>
68                          <item> San Francisco</item>
69                     </one-of>
70                </rule>
71           </grammar>
72      </salt:grammar>
73      <salt:bind targetelement = "iptToCity" value="//"/>
74 </salt:listen>

    

75 </body>
76 </html>

Figure 3: Multimodal application written using SALT tags. The bolded code in Figure 3 replaces the bolded code in Figure 2.