GuideML Syntax
Created | Updated Apr 16, 2003
Most GuideML tags act as commands that describe how to format the text - they can describe its size, colour and even position on the page. Some tags can be used to insert pictures and smileys into the entry.
Tags
There are usually two tags around the text - an opening tag and a closing tag. This is so the computer can tell how much text needs to have the formatting applied. If you used just an opening tag, the computer wouldn't be able to tell whether you wanted to apply the formatting to a word, a sentence, a paragraph or the whole entry.
The opening tag has the form <COMMAND>. The closing tag has the form </COMMAND> - the same as the opening tag, but with the addition of a forward slash (/) before the command name. In between these tags goes the content on which the command should operate.
Lowercase tags also work in GuideML. However, if you use an uppercase opening tag, you must then use an uppercase closing tag. Similarly, if you use a lowercase opening tag, you must use a lowercase closing tag. This is because the parser case-sensitive. Mixed case tags are never allowed.
Here are some simple GuideML commands:
<B>Bold text</B> creates Bold text. <I>Italicised text</I> creates Italicised text.
It is important to remember that all open tags are closed and that you must close tags in the reverse order to opening them. If you start <B><I>Text in bold-italics, you must finish </I></B> not </B></I>. Tags must be nested and not overlapped.
Self-closing tags
All GuideML tags can be made self-closing tags. A self-closing tag contains a command name and a '/' and, as it is self-closing, does not require a second closing tag. Rather than specifying the formatting of content between a tag pair, self-closing tags are usually used to define an object with associated behaviour.
While all GuideML tags can be made self-closing, it clearly makes much more sense to have a self-closing <SMILEY> tag than a self-closing <B> tag. The simplest example of a self-closing tag is the 'line break' - <BR/>.