conditionalElements

Element Group Information

Model

Children: condition, random

Used By

Source

<xs:group name="conditionalElements">
  <xs:choice>
    <xs:element name="condition">
      <xs:annotation>
        <xs:documentation>The condition element instructs the AIML interpreter to return specified contents depending upon the results of matching a predicate against a pattern. NOTE: The definition in this Schema is currently far too permissive. AIML conditions have several forms and constraints that can't be expressed using W3C Schema alone. For this reason, AIML objects that validate using this Schema alone may not actually be valid AIML.</xs:documentation>
        <xs:appinfo>
          <sch:pattern name="valid condition type">
            <sch:rule context="aiml:condition">
              <sch:assert test="(@name and @value and not(aiml:li)) or                                 (@name and not(@value) and aiml:li[@value and not(@name)] and not(aiml:li[@name]) and count(aiml:li[not(@value) and not(@name)]) <= 1) or                                 (not(@name) and not(@value) and aiml:li[@name and @value] and not(aiml:li[(@name and not(@value)) or (@value and not(@name))]) and count(aiml:li[not(@value) and not(@name)]) <= 1)">A condition must be a block condition, a single-predicate condition, or a multi-predicate condition.</sch:assert>
            </sch:rule>
          </sch:pattern>
        </xs:appinfo>
      </xs:annotation>
      <xs:complexType mixed="true">
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
          <xs:any namespace="##any" processContents="lax"/>
        </xs:sequence>
        <xs:attribute name="name" type="PredicateName"/>
        <!--<xs:attribute name="value" type="SimplePatternExpression"/>-->
        <!-- UR d2t: SimplePatternExpression not defined -->
        <xs:attribute name="value" type="xs:string"/>
      </xs:complexType>
    </xs:element>
    <xs:element name="random">
      <xs:annotation>
        <xs:documentation>The random element instructs the AIML interpreter to return exactly one of its contained li elements randomly.</xs:documentation>
      </xs:annotation>
      <xs:complexType>
        <xs:sequence>
          <xs:element name="li" type="MixedTemplateContentContainer" maxOccurs="unbounded"/>
        </xs:sequence>
      </xs:complexType>
    </xs:element>
  </xs:choice>
</xs:group>