Element | Description |
---|---|
CDLib | The CD library root element that contains all the other elements. |
CD | A container element that contains information about a CD. |
artist | An element that contains the name of a musician on the CD. |
title | An attribute that describes the title of the CD. |
format | An element that describes the number of CDs for this title. |
description | An element that provides a description of the CD. |
price | An element that provides the price of the CD. |
You have now specified the content models for each of the elements. A CDLib element can only contain CD elements, whereas a CD element can contain the artist, format, description, and price elements. The artist, format, description, and price elements cannot contain any other elements, they can only contain text.
Since you wanted the CD element to be able to contain more than one element, you defined its Content type to be Children Content. This caused a group node to be automatically added to the CD element. The group node enables you to add as many elements to an element's content model as you like. It also determines whether the elements are sorted in sequence or are available as a choice (you can only select one option or the other) and how often the group of elements can occur.
A CD library typically contains more than one CD. To indicate this in your DTD, you need to change the content model for the CDLib element:
The CD library can now contain as many CDs as you want to add to it.
You also need to make some changes to the artist and the format content models:
<!ELEMENT CD (artist+,format?,description,price)>