One is in fact equal to on...">

Are "if" statements allowed in vxml?

Are nested 'if' statements allowed? eg:

<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>

      

I realize I can rewrite this condition with a statement &&

, but the logic I am trying to do would be messy to repeat in the if elseifs chain what it should be.

+2


source to share


2 answers


Yes, according to the schema definition found here . if

is an element executable.content

that is allowed to contain a sequence of zero or more elements executable.content

.



+3


source


Adding to @ John's answer (as comments are word-limited):

This is true for VXML 2.1 too: 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>

      

0


source







All Articles