3.1 Create the Document

The first step is to create the document. To do this, open a text editor and enter the following text (or download the source file referenced above):

<?xml version="1.0" encoding="UTF-8"?>
<cmrl xmlns:dotgo="http://dotgo.com/cmrl/1.0">
  <match pattern="*">
    <message>
      <content>Hello world!</content>
    </message>
  </match>
</cmrl>
Save the document as "index.cmrl."

So what does it all mean? Let's have a look at the document, line by line.

Line 1:  <?xml version="1.0" encoding="UTF-8"?>
This line indicates that the document is an XML document, which is necessary because CMRL is a variety of XML. An opening line like this is required of any XML document and hence of any CMRL document.
Line 2:  <cmrl xmlns:dotgo="http://dotgo.com/cmrl/1.0">
This line indicates that the document is a CMRL document. A line like this is required of any CMRL document.
Line 3:    <match pattern="*">
This line introduces the match tag, which is a fundamental aspect of CMRL. A match specifies a pattern against which the query is compared to determine how the query is to be routed or resolved. In this case, the match pattern is the "default" match pattern (represented by the wild-card character "*") and there are no other match patterns specified in the document, so any query that is presented to the document will satisfy this match.
Line 4:      <message>
This line introduces the message tag, which is another fundamental aspect of CMRL. Every terminating match must contain one (and only one) terminating node, of which a message is the simplest example. A message must contain content (i.e. the body of the message) and may in addition contain other constructs (which are beyond the scope of this document).
Line 5:        <content>Hello world!</content>
This line contains the content of the message. In this case, the content is the simple text string "Hello world!" enclosed by the opening <content> and closing </content> tags.
Line 6:      </message>
This line closes the <message> tag opened in line 4.
Line 7:    </match>
This line closes the <match> tag opened in line 3.
Line 8:  </cmrl>
This line closes the <cmrl> tag opened in line 2.