Elements

Posted by Nick Gammon on Mon 04 Jun 2001 11:52 AM — 1 posts, 6,244 views.

Australia Forum Administrator #0
Elements are like HTML tags.

eg.


<bold> <color red>


They start with a "<" and end with a ">".

Elements may not contain a "<" or ">" symbol, unless inside quotes.



Quotes

You may use quotes inside an element, in which case you may use "<" or ">" inside the quotes. You should use quotes where an argument (parameter) to a tag contains spaces or other special characters.

eg.


<send "go west">


Single or double quotes are permitted. Whichever quote is used, the other one is permitted inside the quotes.


<send "take 'large sword'">


You can use entities inside elements to represent characters that are otherwise hard to use, in particular:


&#39; - single quote
&#34; - double quote ( or &quot; )


You might do this if you needed to use a single quote within a quoted string, eg.


<send 'take "'Nick&#39;s sword"'>


(ie. this would send: take "Nick's sword" )



Defining your own elements

You can extend the language by defining your own elements, eg. if you want to use bold and underline a lot together you could do this:


<!ELEMENT bu '<b><u>' >


This defines "bu" as <b><u>.

So, you could use it like this:


You see a <bu>large</bu> rabbit!