AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

AIML v2 - attributes and sub-elements
 
 

On reading the AIML v2 draft I noticed the proposal to allow attributes to be replaced by sub-elements with the same name. Is the intent it should always be possible to go from the one form to another? (meaning an attribute could be moved to a sub-element, and the sub-element can be moved back to an attribute)

Or is it possible the sub-elements contain other template-side XML, possibly even including srai calls?

I am curious for the motivation for this change. It makes the AIML harder to read which is a shame.

 

 
  [ # 1 ]

Yes, you can put other template-side AIML expressions inside the attribute subtags.  The rationale is to make attribute values more dynamic.

Consider a simple example where the bot checks to see if the client is the same age as the bot.

<condition name="age">
<
li value="17">We are the same age.</li>
<
li>We are different ages.</li>
</
condition

What happens when the bot turns 18? 

We might like to use a bot property like

<condition name="age">
<
li value="<bot name="age"/>">We are the same age.</li>
<
li>We are different ages.</li>
</
condition

But

<li value="<bot name="age"/>"

is not a valid XML expression.

If we move the value attribute to a subtag however, we can get the result we want:

<condition name="age">
<
li><value><bot name="age"/></value>We are the same age.</li>
<
li>We are different ages.</li>
</
condition

 

 

 
  login or register to react