MCs-051, June2007,1(iv), Three type of entities

Internal Entities :
If entities stored in declaration tag within same document, it is called internal entity. for example
<!ENTITY BCA "Bachelor of Computer Application" >
It is internal entity and we can use it as &bca; anywhere in the document. When XML parser process these entities, it replaces them to their corresponding values.
External Entities :
Entities those point external source of contents like pointing external xml file are referred as External entities. for example;
<ENTITY course SYSTEM "/location/course.xml">
this entity is pointing external document course.xml. where XML parser interpret this entity, contents of course.xml document are inserted at the location of entity.
Parameter Entities.
Parameter are entites those are used to hold the DTD's declarations as a parameters. Using parameter entities (prefixed with a %), a type entity can be created. Then this entity can replace the parameter list. The % type; entity needs to be declared as follows:

<!ENTITY %type "(retail | food )">

The store element declaration now returns to a somewhat more readable list like this:

<!ELEMENT store (%type;, name,phone,promo,image)>

No comments:

Popular Posts