Next / Previous / Contents / TCC Help System / NM Tech homepage

4. Element declarations

In a DTD, an element declaration defines one of the kinds of elements you can use, that is, one of the tag types.

All element declarations have this general form:

    <!ELEMENT gi (content)>

where gi is the element name (also called the “generic identifier”) and the content describes what content (if any) can go inside the element. The generic identifier must follow the rules for XML names, above.

The content part describes the syntax of the element's content using a general notation with a number of different parts. The next few sections describe the items that can go into the content.

4.1. Declaring empty elements

If you don't want a certain element to have any content, that is, you want that element always to be represented by an empty tag (see above), use this element declaration:

    <!ELEMENT gi (EMPTY)>

For example, if your DTD contains this declaration:

    <!ELEMENT pagebreak (EMPTY)>

then an XML document conforming to this DTD could contain a tag that looks like:

    <pagebreak/>