Dear Forum
AIML v2 has the useful new var attribute to declare variables local to a category. Eg we can do this:
<category>
< pattern > THE BEST BOT IS * </pattern>
<template>
<think>
<set var="best"> <star index="1"/ > </set>
</think>
<condition>
<li var="best" value="UBERBOT"> That`s right! </li>
<li> You are sadly confused! </li>
</condition>
</template>
</category>
The above code is is easy - we get the ‘star’ parameter, store it in the variable ‘best’, then check it using a condition. But the AIML v2 document also says attributes can be expressed as sub-elements:
<category>
< pattern > THE BEST BOT IS * </pattern>
<template>
<think>
<set>
<var>best</var>
<star>
<index>1</index>
</star>
</set>
</think>
<condition>
<li>
<var>best</var>
<value>UBERBOT</value>
That`s right! </li>
<li> You are sadly confused! </li>
</condition>
</template>
</category>
It has taken me many years to grudgingly appreciate the zen-like beauty of AIML - however I think allowing attributes to be sub-elements is a big mistake because:
- It is much more verbose as can be seen above (20 lines instead of 12)
- It is conceptually confusing which will deter AIML beginners, and that is a bad thing.
- In the <think> tag above, it looks as if <var> and <star> are possible attributes of <set> which is not always the case.
- There is ambiguity about whether sub-elements (var, index, value) are attributes or elements, which makes it difficult to construct an XML schema for an AIML v2 document. Although this may seem esoteric, it will make it difficult to convert AIML v2 to or from other XML formats.
Therefore I would ask the AIML v2 committee (whoever they may be) to reconsider this decision.