voiceXML,基本流控制。“转到”标记不起作用

voiceXML,基本流控制。“转到”标记不起作用,xml,voicexml,voxeo,Xml,Voicexml,Voxeo,我已经编写了这个基本的voiceXML应用程序,但是我在一个基本的流控制问题上被困了好几个小时。goto标记()不起作用。我一直在循环变量名偏移量。任何帮助都会很好 提前谢谢 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN" "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dt

我已经编写了这个基本的voiceXML应用程序,但是我在一个基本的流控制问题上被困了好几个小时。
goto
标记(
)不起作用。我一直在循环变量名偏移量。任何帮助都会很好

提前谢谢

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vxml PUBLIC "-//BeVocal Inc//VoiceXML 2.0//EN" "http://cafe.bevocal.com/libraries/dtd/vxml2-0-bevocal.dtd">
<vxml xmlns="http://www.w3.org/2001/vxml" xmlns:bevocal="http://www.bevocal.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0">
    <form>
        <field name="offset">
            <grammar src="map.xml#cities" type="application/grammar-xml"/>
            <prompt>
                What city would you like the time for?
            </prompt>

            <catch event="noinput nomatch" count="1">
                Please say the city that your are living at. For example, chicago, los angeles or new york city
                <reprompt/>
            </catch>

            <catch event="noinput nomatch" count="2">
                Apparently the provided city is not in our system. Lets try something different.
                <goto nextitem="countryState" />
                <disconnect/>
            </catch>

            <filled>
                <if cond="offset == '-8'">
                    <prompt>You are living in UTC offset of <value expr="offset"/></prompt>

                    <elseif cond="offset == '-7'"/>
                    <prompt>You are living in UTC offset of <value expr="offset"/></prompt>

                    <elseif cond="offset == '-6'"/>
                    <prompt>You are living in UTC offset of <value expr="offset"/></prompt> 

                    <elseif cond="offset == '-5'"/>
                    <prompt>You are living in UTC offset of <value expr="offset"/></prompt>

                    <elseif cond="offset == '-3.5'"/>
                    <prompt>You are living in UTC offset of <value expr="offset"/></prompt>
                </if>
            </filled>
        </field>

        <field name="formatTime">
            <prompt>
                Twelve hour or twenty four hour clock?
            </prompt>
            <grammar type="application/x-nuance-gsl">
                [[twelve (twenty four)] ?hour]
            </grammar>
        </field>

        <script>
            <![CDATA[
            var d = new Date();
            function calcTime() {
                // create Date object for current location
                var d = new Date();

                // convert to msec
                // subtract local time zone offset
                // get UTC time in msec
                var utc = d.getTime() - (d.getTimezoneOffset() * 60000);

                // create new Date object for different city
                // using supplied offset
                var nd = new Date(utc + (3600000 * (countryState ? countryState : offset)));

                // return time
                if (formatTime == "twelve hour") {
                    return "" + ((nd.getHours() > 12) ? (nd.getHours() - 12) : (nd.getHours()) ) + " and " + nd.getMinutes() + " minutes.";
                } else {
                    return "" + nd.getHours() + " and " + nd.getMinutes() + " minutes";
                }
            }
          ]]> 
        </script>

        <block>
            <prompt>Current time is <value expr="calcTime()" /> </prompt>
            <prompt>Thank you. Bye.</prompt>
            <disconnect/>
        </block>


        <field name="countryState">
            <prompt>
                If you are in U.S., which U.S. state your are currently living in? If you are outside of U.S., which country you are currently living in?
            </prompt>

            <grammar src="map.xml#countryState" type="application/grammar-xml"/>

            <filled>    
                <if cond="countryState == '+8'">
                    <prompt>You are living in UTC offset of <value expr="countryState"/></prompt>

                    <elseif cond="countryState == '+1'"/>
                    <prompt>You are living in UTC offset of <value expr="countryState"/></prompt>

                    <elseif cond="countryState == '+0'"/>
                    <prompt>You are living in UTC offset of <value expr="countryState"/></prompt>

                    <elseif cond="countryState == '-6'"/>
                    <prompt>You are living in UTC offset of <value expr="countryState"/></prompt>
                </if>
                <goto nextitem="formatTime" />
            </filled>
        </field>
    </form>
</vxml>

你想去哪个城市?
请说出你居住的城市。例如,芝加哥、洛杉矶或纽约市
显然,提供的城市不在我们的系统中。让我们试试别的。
你现在生活在一个新的世界里
你现在生活在一个新的世界里
你现在生活在一个新的世界里
你现在生活在一个新的世界里
你现在生活在一个新的世界里
十二小时还是二十四小时?
[十二(二十四)]?小时]
12) ? (nd.getHours()-12):(nd.getHours())+”和“+nd.getMinutes()+”分钟。“;
}否则{
返回“+nd.getHours()+”和“+nd.getMinutes()+”分钟”;
}
}
]]> 
当前时间是
非常感谢。再见。
如果您在美国,您目前居住在哪个州?如果您不在美国,您目前居住在哪个国家?
你现在生活在一个新的世界里
你现在生活在一个新的世界里
你现在生活在一个新的世界里
你现在生活在一个新的世界里

您遇到了哪些提示?只有偏移字段提示重复,或者您是否得到第一个catch或filled提示?您的平台日志是否提供了正在发生的事情的任何细节?@JimRush。我听到第一次和第二次接球。在第二次捕获中,在说:“显然提供的城市不是……”之后,它应该转到countryState。但事实并非如此,它再次开始循环,说“你想去哪个城市?”没有什么明显的。检查平台日志。另外,尝试在countryState字段之后添加另一个字段或块。如果以某种方式设置了变量countryState,则可能会跳过该字段(如果设置了,FIA通常会跳过,但我希望goto会覆盖FIA导航逻辑)…胡乱猜测,不太可能是正确的,但可能会帮助您解决问题。它不会被忽略,因为它没有触及断开连接。它正在做一些事情。@JimRush我能够通过包装解决这个问题。。。使用元素,但我现在有范围问题。我的问题是:如何跨表单访问元素。例如,如果我有表单ID,如何访问表单中的元素。在particular中,如何在java脚本或范围标记中访问它@阿尔法有趣的解决方案。听起来像是一个浏览器错误。在任何情况下,对于您的问题,在表单之外创建一个脚本块(即页面范围)。在块中定义变量。您可以从任何其他元素中读取或写入值。对于较大的应用程序,可以在根文档中定义全局数据。