Defining Elements in DTDs

You can define an element in the Text or Tree tab.

In the Text tab

In the Text tab, you enter the text that defines your element and describes its structure. For example, to define a Catalog element that can contain one or more Publisher elements, followed by zero or more Thread elements, followed by one or more Book elements, you would enter the following:

<!ELEMENT Catalog ((Publisher)+,((Thread)*,(Book)+))>


When you define elements in the Text tab, you must know the syntax and keywords for what you want to define. This information is publicly available on the World Wide Web. Stylus Studio documentation does not include instructions for defining a DTD in the Text tab. For DTD information, see,

In the Tree tab

When you use Stylus Studio, it is easier to define an element in the Tree tab. In the Tree tab, you click New Element Definition , and Stylus Studio takes care of the syntax and keywords. In the Tree tab, definition of an element requires that you

1. Create the element by specifying its name. To do this, see Defining Elements in the DTD Tree Tab, which is the first topic in this section.
2. Define the structure of the element by specifying modifiers, defining where raw data is allowed, and adding references to other elements. To help you do this, this section discusses the following topics:
Free Stylus Studio XML Training:
W3C Member