Quackit Logo

FREE Hosting!

With every domain name you register with ZappyHost, you get FREE hosting.

$1.99 Domain Names

With every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99.

DTD General Entities

Print Version

You may remember the lesson on creating entities. The entity we created in that lesson is known as a General Entity Reference. A general entity reference is used in the target XML document/s.

This lesson refreshes our memory on how to declare a general entity. The following lesson introduces another type of entity; the parameter entity.

Syntax

The <!ENTITY> declaration for general entities has the following syntax:

<!ENTITY name definition>

You can also declare external general entities. This enables you to use an entity from a remote file. You declare external general entities using the following syntax:

Private:

<!ENTITY name SYSTEM uri>

Public:

<!ENTITY name PUBLIC FPI uri>

Example

<!ENTITY author "Homer Flinstone">

After declaring the entity named "author", we can now use it in our XML document:

<books>
  <book>
    <name>Life as a cartoon character</name>
    <author>&author;</author>
  </book>
</book>

Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
               
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!