Working with Elements

Elements are declared in a DTD using element declarations, which take the following form:

<!ELEMENT ElementName
						Type>

The name of the element determines the name of the tag(s) used to mark up the element in an XML document and corresponds to ElementName in the element declaration. This name must be unique within the context of a single DTD. The type of the element is specified in Type, which is also known as the content specification for the element. XML supports four types of elements:

  • Empty—The element doesn't contain any content, but it can contain attributes.

  • Element only—The element only contains child elements.

  • Mixed—The element contains a combination of child elements and character data.

  • Any—The element contains any ...

Get XML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.