HTML.and.XHTML.The.Complete.Reference.4th.Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

HTML.and.XHTML.The.Complete.Reference.4th.Edition [Electronic resources] - نسخه متنی

Thomas Powell

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
توضیحات
افزودن یادداشت جدید








Parameter Entities


An entity is essentially a macro that allows a short name to be associated with replacement text. Parameter entities define replacement text used in DTD declarations. Syntactically, a parameter entity is distinguished by using the percent (%) symbol. Its general form is shown here:


<!ENTITY % name "replacement text">

It is used in DTDs as follows:


%name;

Parameter entities are a convenient way to define commonly occurring pieces of a DTD so that changes only need to be made in one place. We see in XHTML a parameter entity to define the core attributes common to most elements.


<!ENTITY % coreattrs
"id ID #IMPLIED
class CDATA #IMPLIED
style %StyleSheet; #IMPLIED
title %Text; #IMPLIED"
>

Notice that entity %coreattrs further references entities (%StyleSheet; and %Text;) to define values for the style and title attributes. Once defined, the core attributes could be added to an attribute list declaration for an element, as follows:


<!ATTLIST some-element %coreattrs;>

Oftentimes, you will see entities that in turn contain further entities. For example, under HTML 4.0 the coreattrs parameter entity is used with the %i18n and events parameter entities to define the expansion text for an aggregate entity called attrs.


<!ENTITY % attrs "%coreattrs %i18n %events">


/ 252