Declaring an entity

For remaining entity types, a declaration is almost always required. The declaration specifies the entity name, and either directly contains the entity itself, or contains a reference to an entity held elsewhere.

Usually, the declaration takes the form of a markup declaration. The 'ENTITY' keyword identifies an entity declaration:

<!ENTITY .......>

This keyword may be directly followed by the name of the entity being declared. The name can be any length, but the characters allowed in the name are restricted in the same way as element and attribute names. Legal names include '_MyEnt' and 'my.ent'. The name is case-sensitive, so an entity named 'MyEntity' is not the same as an entity named 'myentity', or another named 'MYENTITY':

<!ENTITY MyEntity .......>

SGML Note

a default entity cannot be defined.


It is possible to define the same entity more than once, but only the first declaration is acknowledged:

<!ENTITY myentity .......>

<!-- IGNORED -->
<!ENTITY myentity .......>

Entity declarations cannot appear within the document content. Instead, they must be inserted at the top of the document, within the document type declaration:

<!DOCTYPE MyBook [
  <!ENTITY .......>
  <!ENTITY .......>
  <!ENTITY .......>
]>

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.174.55