DTD Schema Editor Tree Tab

To display the DTD schema editor in Stylus Studio, select File > New > DTD Schema from the Stylus Studio menu bar. Click the Tree tab.

Alternative: In Stylus Studio, open a file with .dtd as the file name extension. Stylus Studio automatically opens the file in the DTD schema editor.

The Tree tab is the recommended way to define a DTD schema. You need not know DTD syntax. To add an element, entity, comment, or white space to your DTD, click the DTD node at the top of the display. Next, click the appropriate button in the left tool bar of the Tree tab.

Buttons

Change the font used to display text in the DTD schema editor.

Delete the selected node.

Change the name of the selected node.

Move the selected node up.

Move the selected node down.

Toggle the display of white space.

Toggle Display of Entity References toggles the display of entity references in the tree. Stylus Studio displays either the entity symbols or the entity values.

Left Tool Bar Buttons

Table 160 describes the buttons in the left tool bar of the Tree tab. These buttons allow you to define elements, entities, and comments in your DTD.

Button
Description of New Node
New Element Definition
Define an element name.
New Attribute
Define an attribute name. This attribute is associated with the element that was selected when you clicked New Attribute.
New Modifier
Click an element node, and then click this button to specify a modifier for the data or subelements that you want the selected element to contain. You can specify the following modifiers:
  • Optional - It is optional whether the contained node appears in an instance document. If the contained node does appear, there can be only one.
  • Zero or more - There can be zero, one, or multiple instances of the contained node in an instance document.
  • One or more - This contained node is required. There must be at least one instance, and there can be multiple instances, of this contained node in an instance document.
  • Choice - The selected element can contain one of the subelements for which there are references after this modifier.
  • Sequence - This selected element can contain other elements. If the contained elements are present in an instance document, the sequence of the contained elements must be the same sequence in which they are defined.
New Reference to Element
Click a DTD Modifier node ( Choice or Sequence) and then click this button to specify an element that the parent element of the Choice or Sequence node can contain.
Add #PCDATA
Click a DTD Modifier node, and then click this button to add character data to the element node.
New Entity
Click the DTD node at the top of the document. Then click New Entity to define a general entity.
New Parameter Entity
Click the DTD node at the top of the document. Then click New Parameter Entity to define a parameter entity.
New Text
Click the DTD node at the top of the document. Then click New Text to add white space between elements, entities, or comments. Click the up arrow to move the white space.
New Comment
Click the DTD node at the top of the document. Then click New Comment to add a comment. Use the up arrow to move the comment. It can be between elements or entities. You cannot insert it among the nodes that define an element.
Table 160. Node Button Descriptions

For More Information

What Is a DTD?

Defining Elements in DTDs

About Modifiers in Element Definitions in DTDs

Defining General Entities and Parameter Entities in DTDs

Adding Comments to DTDs

 
Free Stylus Studio XML Training:
W3C Member