Let's start by considering a simple example. Consider the following CMRL fragment under the internet domain name "example":
<match pattern="">
<message>
<content>Welcome to example.com<br/>
Reply # for result<br/>
<a query="example circle"/> Circle<br/>
<a query="example square"/> Square<br/>
<a query="example triangle"/> Triangle</content>
</message>
</match>
<match pattern="circle">
<message>
<content>You have selected a circle</content>
</message>
</match>
<match pattern="square">
<message>
<content>You have selected a square</content>
</message>
</match>
<match pattern="triangle">
<message>
<content>You have selected a triangle</content>
</message>
</match>
Here the query "example circle" produces the response "You have selected a
circle," the query "example square" produces the response "You have
selected a square," and the query "example triangle" produces the response
"You have selected a triangle." The query "example" produces the response
Reply # for result (1) Circle (2) Square (3) TriangleThe query "example" followed immediately (in the very next text message) by the reply "1" produces the response "You have selected a circle." Similarly, the query "example" followed by the reply "2" produces the response "You have selected a square," and the query "example" followed by the reply "3" produces the response "You have selected a triangle."
How does it work? The "null" match contains a <message> tag that contains a <content> tag that contains three <a> tags. The <a> tag is used within a <content> tag. The <a> tag must contain the attribute query and may contain a text string. The system turns the <a> tags within a <content> tag into links, which it enumerates, formats, and displays. If a <content> tag contains an <a> tag, then the reply sent by the user is treated differently than normal; in particular, if the reply matches one of the enumerated links, then the query specified by the corresponding <a> tag is executed as though it were an incoming request. (If the reply sent by the user does not match one of the enumerated links, then it is treated as a normal query.)