2009-08-19 11 views
2

'if'ステートメントはネストされていますか? 例:vxmlでネストされた 'if'ステートメントが許可されていますか?

<if cond="1 == 1"> 
    <if cond="2 == 2"> 
     One is in fact equal to one and Two is in fact equal to two 
    <else/> 
     One is in fact equal to one but Two is never not equal to two 
    </if> 
<else/> 
    One is never not equal to one 
</if> 

私は「&&」ステートメントで、この状態を書き換えることができますが、私がやろうとしていますロジックは、それがなければならないであろうelseifs場合の連鎖に繰り返し続けるために厄介だろう実現。

答えて

3

はい、スキーマの定義によれば、hereです。 ifは、executable.content要素であり、0以上の要素のシーケンスを含むことができます。executable.content要素。

+0

スペックdoesntのは、それについて多くを語ります。あなたがスキーマ定義を指しているといいですね。 – Anupam

0

は(コメントは字数制限があるので)を@にジョンの答えを追加:

これは、同様にVXML 2.1のための真のまま:https://www.w3.org/TR/voicexml21/vxml.xsd

<xsd:element name="if"> 
<xsd:sequence> 
<xsd:group ref="executable.content" minOccurs="0" maxOccurs="unbounded"/> 
<xsd:sequence minOccurs="0" maxOccurs="unbounded"> 
<xsd:element ref="elseif"/> 
<xsd:group ref="executable.content" minOccurs="0" maxOccurs="unbounded"/> 
</xsd:sequence> 
<xsd:sequence minOccurs="0" maxOccurs="1"> 
<xsd:element ref="else"/> 
<xsd:group ref="executable.content" minOccurs="0" maxOccurs="unbounded"/> 
</xsd:sequence> 
</xsd:sequence> 
<xsd:attributeGroup ref="If.attribs"/> 
</xsd:complexType> 
</xsd:element> 
関連する問題