!ENTITY - define your own entities

Posted by Nick Gammon on Tue 05 Jun 2001 03:12 AM — 1 posts, 9,563 views.

Australia Forum Administrator #0
You can create your own entities on-the-fly by sending an entity definition from the server to the client.

eg.


<!ENTITY clan_name "Wolf Clan" >


The entity name may not be the name of an existing built-in entity (eg. "lt" ) however you may redefine server-defined entities if you want to.


Rules for entity names

The name must start with a letter, and then consist of:

* letters (A-Z, or a-z)
* numbers (0-9)
* underscore, hyphen or period characters


Case sensitivity

Entity names are not case-sensitive.


Entities inside entities

You are allowed to use other entity names inside an entity definition, for example:


<!ENTITY clan_name "&quot;&lt;Wolf Clan&gt;&quot;" >


Then if you later display &clan_name; you would see:


"<Wolf Clan>"


The quotes, "<" and ">" are part of the entity definition.