wsr macros else if XML中的语句

时间:2014-07-09 05:11:18

标签: xml if-statement macros speech-recognition

我正在尝试为WSR创建一个宏,它需要重新启动系统的输入并通过询问是或否来确认它?然后,如果是,宏将重新启动系统,如果没有,它只是回复取消操作。到目前为止,这就是我所拥有的......

<speechMacros>
<command>
<listenFor>Restart the System</listenFor>
<speak>Confirm system restart. yes or no?</speak>
</command>
<command>
<listenFor>[...]chester</listenFor>
<if [...]="yes">
<run command="C:\Windows\System32\shutdown.exe" params="-r -t 00"/>
<else[...]="no">
<speak>canceling operation</speak>
</else>
</if>
</command>
</speechMacros>

我试过但它给了我错误说...

名称以无效字符开头。

行:9 Col:5

<if[...]="yes">

我该如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

如果你使用<confirm></confirm>块并在标签之间放置提示,则用户将收到是/否确认对话框,可以进行语音回答。 如果选择yes,它应该执行你的命令,如果没有它应该退出而不执行它。