2

是否允许嵌套“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>

我意识到我可以用 ' ' 语句重写这个条件,&&但是我试图做的逻辑会很混乱,因为它必须在 if elseifs 链中不断重复。

4

2 回答 2

3

是的,根据在这里找到的架构定义。Anif是一个executable.content元素,允许包含零个或多个executable.content元素的序列。

于 2009-08-19T18:51:36.120 回答
0

添加到@John 的答案(因为评论有字数限制):

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>
于 2017-02-15T11:02:53.497 回答