RXML is an XML compliant programming langauge which can be used to produce
dynamic as well as static content. The core of RXML is tags and entities,
but unlike XML both tags and entities may be expanded into a dynamic value.
To make it easier to use entities several entities are grouped into something
called a scope. You can think of a scope as a bucket with variables, so when
you reference a variable with an entity you first select the right bucket and
then the right variable. In the example below the variable thing in the scope
var is set to "Book" and the variable thing in the scope form is set to "Chair".
In the last row of the example these to variables are inserted into the document.
<set variable='var.thing'>Book</set>
<set variable='form.thing'>Chair</set>
My &var.thing; is on the &form.thing;.
|
My Book is on the Chair. |
|
As a rule of thumb entities are expanded first and the tags are evaluated later, as
is exemplified in the next example. First var.thing is set to "Book" and then
form.thing is set to the value in var.thing, i.e. "Book".
<set variable='var.thing'>Book</set>
<set variable='form.thing'>&var.thing;</set>
My &var.thing; is on the &form.thing;.
|
My Book is on the Book. |
|
You can also use entities to insert values into the attributes of tags, exemplified by
these two examples.
<set variable='var.variable'>var.title</set>
<set variable='&var.variable;'>Autour de la Lune</set>
Title: &var.title;
|
Title: Autour de la Lune |
|
<set variable='var.variable'>title</set>
<set variable='var.&var.variable;'>Autour de la Lune</set>
Title: &var.title;
|
Title: Autour de la Lune |
|
Evaluation order
The general evaluation order of RXML is from top to bottom of the page, and inside
and out in terms of tag levels. The "top to bottom" means that if two unnested tags
appears on a page, the first one on the page is evaluated before the second one.
<set variable='var.value'>One</set>
&var.value;<br />
<append variable='var.value'> Two</append>
&var.value;<br />
|
One
One Two
|
|
The "inside and out" on the other hand describes how tags behave if they are nested.
Then the innermost first gets to produce its result. That result is then handed over to
the embracing tag, which in turn produces its output with the first tags output as input.
<case case='upper'><date part='wday' type='string' /></case>
|
MONDAY |
|