voicexml外部文法の出力とフィールド要素を補充する
質問
ユーザーが「ヘルプ」と言ったら、次のフィールドが満たされず、ユーザーがすべての可能なオプションを取得することを望みます。
<form id="test">
<field name="var1">
<prompt bargein="true" bargeintype="hotword" >say xy </prompt>
<grammar src = "grammar.grxml" type="application/srgs+xml" />
<filled>
<assign name="myProdukt" expr="var1" />
you said <value expr="myProdukt"/>
</filled>
</field>
(外部文法には「P1」、「P2」、「P3」が、ユーザーが「ヘルプ」と言い、システムは「P1」、「P2」、「P3」と言い、ユーザーは再び選択できます。 「ヘルプ」という言葉も外部の文法にある必要がありますよね?)
前もって感謝します
解決
はい、アクティブな文法には、値「ヘルプ」を返す「ヘルプ」発話を含める必要があります。次に、aでイベントをキャッチします help
鬼ごっこ:
<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml" version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd">
<form id="test">
<field name="var1">
<prompt bargein="true" bargeintype="hotword" >say xy </prompt>
<grammar src = "grammar.grxml" type="application/srgs+xml" />
<filled>
<assign name="myProdukt" expr="var1" />
you said <value expr="myProdukt"/>
</filled>
<help>
To choose a product, say,
<!-- whatever the product choices are -->
frobinator, submarine, curling iron, ..
<reprompt/>
</help>
</field>
</form>
</vxml>
あるいは、次のとおりです 乾燥した原理, 、この効果は行うことができます 世界的に Anを使用したアプリケーション用 アプリケーションルートドキュメント 含む link
エレメント。例で app-root.vxml
以下にドキュメントがあります link
グローバルな文法を「ヘルプ」と結合する help
イベント :
<?xml version="1.0"?>
<vxml version="2.1" xmlns="http://www.w3.org/2001/vxml">
<link event="help">
<grammar mode="voice" root="root_rule" tag-format="semantics/1.0"
type="application/srgs+xml" version="1.0" xml:lang="en-US">
<rule id="root_rule" scope="public">
<one-of>
<item weight="1.0">
help
</item>
</one-of>
</rule>
</grammar>
</link>
</vxml>
この文法はどこでもアクティブになります - アクティブなフィールド文法ごとに効果的に統合されます。アプリケーションルートドキュメントに関する詳細情報が必要な場合は、VoiceXML仕様のセクション マルチドキュメントアプリケーションの実行 説明します。また、参照してください イベントの処理 から Tellme Studio ドキュメンテーション
次に、アプリケーションのページで、 application
の属性 vxml
要素とaで適切に話します help
キャッチブロック:
<?xml version="1.0" encoding="UTF-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml" version="2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/vxml http://www.w3.org/TR/voicexml20/vxml.xsd"
application="app-root.vxml">
<form id="test">
<field name="var1">
<prompt bargein="true" bargeintype="hotword" >say xy </prompt>
<grammar src = "grammar.grxml" type="application/srgs+xml" />
<filled>
<assign name="myProdukt" expr="var1" />
you said <value expr="myProdukt"/>
</filled>
<help>
To choose a product, say,
<!-- whatever the product choices are -->
frobinator, submarine, curling iron, ..
<reprompt/>
</help>
</field>
</form>
</vxml>
もちろん、置くことができます link
フォームと同じページのコードですが、おそらくあなたが望むでしょう help
特定のフィールドの文法で何かと衝突しない限り、アプリケーションのすべてのフィールドに対してアクティブ。