<bind ...> element


The bind element is used to bind values from spoken/dtmf input into the page, and/or to call methods on page elements. The input result processed by the bind element is an XML document containing a semantic markup language (e.g. W3C Natural Language Semantic Markup Language) for specifying recognition results. Its contents typically include semantic values, actual words spoken, dtmf results, and confidence scores. The return format could also include alternate recognition choices (as in an N-best recognition result).


Attributes

Name Data type Default
targetAttribute
script.variable
"value"
targetElement
script.variable
required
targetMethod
object.method
implied
test
xpattern.string
implied
value
xpath.query
implied

Children

none

Parents

Properties

none

Methods

none

Examples

<html xmlns:salt="http://www.saltforum.org/2002/SALT">
...
    <input type="text" name="iptAreaCode" onFocus="dtmfAreaCode.Start()" />
    <input type="text" name="iptPhoneNumber" />
...
    <salt:dtmf id="dtmfAreaCode" onReco="dtmfPhoneNumber.Start()">
        <!-- grammar result will contain "smlAreaCode" node -->
        <salt:grammar src="3digits.grxml" />

        
<salt:bind value="//smlAreaCode"
                 targetelement="iptAreaCode" />
    
</salt:dtmf>
    <salt:dtmf id="dtmfPhoneNumber">
        <!-- grammar result will contain "smlPhoneNumber" node -->
        <salt:grammar src="7digits.grxml" />

        <salt:bind value="//smlPhoneNumber"
                 targetelement="iptPhoneNumber" />
    
</salt:dtmf>

...
</html>

 

<html xmlns:salt="http://www.saltforum.org/2002/SALT">
    <body>
    
         <!-- the data section -->
         <form id="get_team">
            <input name="team" />
            <input name="uid" type="hidden"/>
        </form>

        <!-- The speech section -->
        <salt:prompt id="welcome">
            Welcome, caller!
        </salt:prompt>
        <salt:prompt id="ask">
            Which team would you like the latest results for:
            Arsenal, Chelsea, Spurs or West Ham?
        </salt:prompt>
        <salt:prompt id="confirm">
            I heard <value targetelement="team" />.
            Is this correct?
        </salt:prompt>
        <salt:prompt id="thanks">
            Thank you. Please wait while I get the latest results.
        </salt:prompt>
        <salt:prompt id="retry">
            Okay, let's do this again
        </salt:prompt>
        <salt:prompt id="reprompt">
            Sorry, I missed that.
        </salt:prompt>

        <salt:listen id ="listen_team">
            <salt:grammar src="./teamtypes.grxml" />
            <salt:bind test="/[@confidence $gt$ 10]"
                    targetelement="team" value="//team" />
            <salt:bind test="/[@confidence $gt$ 10]"
                    targetelement="confirm" targetmethod="start" />
            <salt:bind test="/[@confidence $gt$ 10]"
                    targetelement="listen_yesno" targetmethod="start" />
            <salt:bind test="/[@confidence $le$ 10]"
                    targetelement="reprompt" targetmethod="start" />
            <salt:bind test="/[@confidence $le$ 10]"
                    targetelement="ask" targetmethod="start" />
            <salt:bind test="/[@confidence $le$ 10]"
                    targetelement="listen_team" targetmethod="start" />

        </salt:listen>
        <salt:listen id="listen_yesno">
            <salt:grammar src="./yesno.grxml" />
            <salt:bind test="/yes[@confidence $gt$ 10]"
                    targetelement="thanks" targetmethod="start" />
            <salt:bind test="/yes[@confidence $gt$ 10]"
                    targetelement="get_team" targetmethod="submit" />
            <salt:bind test="/no or ./[@confidence $le$ 10]" />
                    targetelement="retry" targetmethod="start"
            <salt:bind test="/no or ./[@confidence $le$ 10]"
                    targetelement="ask" targetmethod="start" />
            <salt:bind test="/no or ./[@confidence $le$ 10]"
                    targetelement="listen_team" targetmethod="start" />

        </salt:listen>

        <!-- call control section -->
        <salt:smex id="telephone" sent="start_listening">
            
<salt:param name="server" value="ccxmlproc" />
           
 <salt:bind targetelement="uid" value="/@uid" />
            <salt:bind test="/Call_connected"
                    targetelement="welcome" targetmethod="queue" />
            <salt:bind test="/Call_connected"
                    targetelement="ask" targetmethod="start" />
            <salt:bind test="/Call_connected"
                    targetelement="listen_team" targetmethod="start" />
        
</salt:smex>

    </body>
</html>

 

Extra info

For details on usage of this element, see the SALT Specification, Version 1.0.