next up previous
Next: An example of WOM --- calculating factorials
Up: The WOM language
Previous: Informal introduction


Syntactically, WOM is a superset of HTML. WOM commands start with a left pointed bracket followed by a name, and may take a sequence of arguments before terminating with a right pointed bracket. The standard way to pass arguments is by keyword rather than position, but the compiler allows some commonly used arguments to be passed also by position:

<TextField t>
<TextField id=t value="" size=10>
<Menu TaxRates options={0,5,10,15,20,22 to 40 by 2}>
<Menu VATChange options={"Scrap it!":0, "Double it!":2}>
<Attribute a>
<Class Top Book>

In the examples above, some of the arguments are simple constants, such as 10 and ""; others, in curly brackets, are lists.

As well as keyworded and positional arguments, WOM recognises ``defaultable Boolean arguments''. These are keyworded arguments with no value specified, where the keyword on its own means that the value must be true. Thus

<File name="d:\ho\Temp.htm" isHTML>
<File name="d:\ho\Temp.htm" isHTML=true>
both mean the same.

In the rest of this paper, I shall use the word element rather than command, for compatibility with HTML terminology.

Some elements act as brackets, and must be terminated by a closing bracket, in the same way as HTML elements like FORM and BLOCKQUOTE. These include WOMForm and OnSubmit:

<OnSubmit rexx>
{ $output~setValue( $input~getValue ) }
Again following HTML terminology, we call these containers. A container will normally hold either a Rexx code insert as above, or more text as below:
  Enter data here:<TextField t>

In general, names are case-insensitive, so

<Menu TaxRates options={0,5,10,15,20,22 to 40 by 2}>
<MENU taxrates OPTIONS={0,5,10,15,20,22 TO 40 BY 2}>
are equivalent. By convention, I write ordinary HTML elements in upper-case, and WOM elements in a mixture of upper and lower-case.

Jocelyn Ireson-Paine
Fri May 30 14:03:06 BST 1997