An element's content model represents any data that can be contained inside or within the content of an element (that is, between the start and end tags of an element in an XML file). Editing an element's content model enables you to determine exactly what the element can (and cannot) contain.
There are four kinds of content models: element content, mixed content, EMPTY content and ANY content
In the element content content model an element can only contain other child elements. In the mixed content content model, an element can contain both character data (text that is not parsed by the XML parser) and other child elements. In the EMPTY content content model, an element cannot contain any other elements or text. In the ANY content content model, the element can literally contain anything - other elements, in any number, and text.
In the DTD editor, you can create elements with any of these content models. When you create an element in the DTD editor, a child element with an EMPTY content model is automatically created.
The following instructions were written for the Resource perspective, but they will also work in many other perspectives.
To edit an element's content model, follow these steps:
Note: If you intend to have mixed content, the value of the first element in your group must be (#PCDATA) (consequently, if you select Mixed Content, two child elements will automatically be created, the first one having a value of (#PCDATA).
Editing a group node
If your element has either element content or mixed content, its content model is represented by a group node. You can add children elements or another group to a group node, and specify how often, and in what manner a group of elements will be available in an XML file associated with your DTD.
Parent topic: Creating elements
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.