HTML and CSS Reference
In-Depth Information
The XML syntax that defines the
<bdo>
tag under XHTML is similar, though you should
notice that many more attributes are now available for this tag:
<!ATTLIST bdo
%coreattrs;
%events;
lang %LanguageCode; #IMPLIED
xml:lang %LanguageCode; #IMPLIED
dir (ltr|rtl) #REQUIRED
>
We note that commonly repeated attributes and values under both HTML and XHTML tend
to be minimized with parameter entities like
%coreattrs
, which will expand to
id
,
class
,
style
, and
title
attributes.
SGML and XML Keywords
The previous SGML example declares the
lang
attribute as having values of type
NAME
,
an alphabetic string.
NAME
is one of several SGML/XML keywords occurring in HTML
and XHTML's declarations of an attribute's type:
•
CDATA
Unparsed character data
•
ID
A document-wide unique identifier
•
IDREF
A reference to a document-wide identifier
•
NAME
An alphabetic character string plus a hyphen and a period
•
NMTOKEN
An alphanumeric character string plus a hyphen and a period
•
NUMBER
A character string containing decimal numbers
Notice that in the previous DTD fragment example for
<bdo>
that the
dir
attribute did
not declare its type using a keyword. Instead, the type is specified using an enumerated list
containing two possible values,
ltr
and
rtl
.
In the previous example for either SGML or XML, the
dir
attribute's default behavior is
specified with a keyword like one of these:
•
#REQUIRED
A value must be supplied for the attribute.
•
#IMPLIED
The attribute is optional.
•
#FIXED
The attribute has a fixed value that is declared in quotes using an additional
parameter. Because the attribute/value pair is assumed to be constant, it does not
need to be used in the document instance.
A default value may also be specified using a quoted string; for example, the enctype
attribute on a form element has the MIME type shown in the string that follows by default:
enctype %ContentType; "application/x-www-form-urlencoded"