condition

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.

Element Information

Model

ANY element from ANY namespace

Attributes

QName Type Fixed Default Use Inheritable Annotation
name PredicateName optional
value xs:string optional

Source

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

Sample

BLANK

BJCHECKBANK

BJMAIN

BADBJBET