From the course: XML Essential Training
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Declaring elements
From the course: XML Essential Training
Declaring elements
- [Instructor] Let's start by declaring elements in a DTD. Declaring elements inside a DTD is accomplished using an element declaration. And these have the format of an angle bracket followed by an exclamation point and the capital word ELEMENT, followed by a name and a content specification. The name field is the name of the element that you're going to be declaring, and the content specification defines what the valid content for the element is. Elements can have one of four different types of what are known as content models. First is the EMPTY content model in which the element has no child elements at all, no texts, no tags, nothing. A good example of this is the image tag and HTML or the horizontal rule tag and so forth. These tags don't have anything inside them. Next is the ANY content model, which is the opposite from EMPTY. This means the element has no content constraints whatsoever. It can contain pretty much anything. Then there's the Element content model, which means…