VXML에서 중첩 된 'if'진술이 허용됩니까?
-
19-09-2019 - |
문제
중첩 된 '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>
이 조건을 다시 작성할 수 있다는 것을 알고 있습니다.&&
'진술이지만, 내가하려는 논리는 그것이 elingeifs의 체인에서 계속 반복하는 것이 지저분 할 것입니다.
해결책
예, 스키마 정의에 따르면 발견되었습니다 여기. an if
이다 executable.content
0 이상의 시퀀스를 포함 할 수있는 요소 executable.content
집단.
다른 팁
@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>
제휴하지 않습니다 StackOverflow