HTML.and.XHTML.The.Complete.Reference.4th.Edition [Electronic resources]

Thomas Powell

نسخه متنی -صفحه : 252/ 217
نمايش فراداده

Attribute Declarations

Once an element's syntax has been defined, we have to address its attributes. All attribute declarations begin with the keyword ATTLIST followed by the element name, attribute name, attribute type, and default data information, as you can see in the following:

<!ATTLIST element-name attribute-name attribute-type default-data>

The HTML 4.0 <BDO> tag type illustrates a small attribute declaration:

<!ATTLIST   BDO
 lang  NAME      #IMPLIED
 dir  (ltr|rtl)  #REQUIRED
>

The XML syntax that defines the <bdo> tag under XHTML is similar but you should notice that more attributes are not available for this tag

<!ATTLIST bdo
  %coreattrs;
  %events;
  lang        %LanguageCode; #IMPLIED
  xml:lang    %LanguageCode; #IMPLIED
  dir         (ltr|rtl)      #REQUIRED
>