Introduction

Some thesauri give entity as a synonym for 'element'. But XML entities are very different to XML elements. They are concerned with the physical components of a document, rather than its logical components. The entire XML document is an entity. Entities are not as simple as elements, since they are used for several distinct purposes. In fact, a number of the key features of the standard are supported by entities. They are used to:

  • create escape-codes for significant markup characters

  • provide a mechanism for representing characters that are not available from the keyboard, or in standard character sets

  • divide long documents into smaller, more manageable chunks

  • create re-usable components that can be shared by many documents

  • include by reference external binary data, such as images

  • assist in the construction of DTDs (see the next chapter).

There are therefore several different kinds of entity, which the following sections explore in detail. But one thing that all entities have in common is that they are divided into two conceptual parts. First, there is the entity itself, which is either an implied or explicitly declared object. When an explicit declaration is required, a markup construct is used to create an entity declaration. But, for its existence to have any meaning, there must be at least one entity reference present to make use of the entity. For most types of entity, there may be any number of references. References generally take the form of names. The entity name is part of its declaration, and also appears in each reference to the entity. The entity name is used to find the relevant entity (and the content of the entity then replaces the reference):



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

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