DTD KeywordsDocument Type Definition (DTD) ELEMENT KeywordThe ELEMENT keyword defines elements that may be a part of the document and their options or requirements. Each element may or may not require the use of other elements within it. There are three parts of the element definition which include:
Ending tag SpecificationsThis part specifies whether beginning or ending tags are required. The following list explains the possibilities.
ELEMENT ContentContent specifies the content of the elements. This uses the word "EMPTY" and special characters combined with names to define content. EMPTYThe word "EMPTY" designates the element has no content. Here's an example from the HTML 4 transitional DTD: <!ELEMENT HR - O EMPTY -- horizontal rule --> CharactersCharacter meanings:
|
In the examples below, the names "ENT1", "ENT2", and so forth are used to describe elements:
<!ELEMENT FRAMESET - - ((FRAMESET|FRAME)+ & NOFRAMES?) -- window subdivision-->
<!ELEMENT TBODY O O (TR)+ -- table body -->
<!ENTITY % pre.exclusion "IMG|OBJECT|APPLET|BIG|SMALL|SUB|SUP|FONT|BASEFONT"> <!ELEMENT PRE - - (%inline;)* -(%pre.exclusion;) -- preformatted text -->
<!ENTITY % head.misc "SCRIPT|STYLE|META|LINK|OBJECT" -- repeatable head elements -->
<!ELEMENT TABLE - - (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)>
<!ELEMENT TR - O (TH|TD)+ -- table row -->
<!ELEMENT DL - - (DT|DD)+ -- definition list -->