Specifying That Multiple Instances of An Element Are Allowed in DTDs

You specify that multiple instances of an element are allowed when you add a reference to that element in another element. When multiple instances of an element are allowed, you specify that there can be either

  • None, one, or more
  • One or more
In the Tree tab, to specify that there can be multiple instances of an element:
1. Define the element that can appear multiple times. See Defining Elements in the DTD Tree Tab.
2. Define the element that contains the element that can appear multiple times. This is the container element.
3. Click the container element name.
4. In the left tool bar, click New Modifier . Stylus Studio displays a drop-down menu.
5. If the container element can contain only one type of element, skip this step. If the container element can contain more than one type of element, double-click Sequence, and then click New Modifier.
6. Double-click Zero or More to allow the container element to contain zero, one, or more instances of an element. Or, double-click One or More to allow the container element to contain one or more instances of an element.
7. In the left tool bar, click New Reference to Element and enter the name of the element that can appear multiple times. If the container element can contain additional types of elements, repeat this step for each one that can appear multiple times.

After you add a reference to an element, you might want to check the definition of the referenced element. To do this, right-click the reference. In the shortcut menu, click Go To Definition. Stylus Studio moves the focus to the definition of the referenced element.

Example 1

Suppose there are some elements that can appear zero, one, or more times, and there are other elements that can appear one or more times. The tree representation for this might look like the following:

book
               

              
Sequence
                   
One or More
                   
	Author
                   
	Format
                   
Zero or More
                   
	Award
                   
	Review
                   

                

In this example, an instance document must contain these elements in the following order:

author
               
format
               
award
               
review
               

            

Example 2

Suppose you want them in the following order:

review
               
format
               
award
               
author
               

            

In this case, the tree representation would look like this:

book
               

              
Sequence
                   
Zero or More
                   
	Award
                   
One or More
                   
	Format
                   
Zero or More
                   
	Review
                   
One or More
                   
	Author
                   

                

Configuring the Java Runtime Engine or Java Development Kit

This page identifies the Stylus Studio modules that require Java runtime and Java compiler components, where you can download these Java components, and how to force Stylus Studio to detect new or changed Java components.

XML Whitepapers

Learn how XML can help you meet your business objectives by reading free XML Whitepapers covering XML, XML Schema, XQuery, SQL/XML, and FIXML technolgies employed in real world case studies.

Government Agencies That Use Stylus Studio

Government agencies all around the nation are pledging their allegiance to Stylus Studio. Come see which government agencies are using the only XML IDE by the people and for the people.

Publishing & Printing

It is really hard to get things to look pretty, especially XML. That's why these publishing & printing companies use Stylus Studio to make a Mona Lisa out of data integration. Check out these top companies that are "stunning" with Stylus Studio!

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member