Defining Data Elements in a Sample DTD

This topic is part of a sequence that starts with Creating a Sample DTD.

In your DTD, suppose you want a book element to be optional. Further, if a book element is present, it must always have exactly one title element and it can have any number of author elements. The title and author elements contain only raw data.

To accomplish this, perform the following steps:
1. At the bottom of the DTD editor, click the Tree tab.
2. Click the DTD node at the top of the tree if it is not already selected.
3. Click New Element Definition , which is the top button in the tool bar on the left side of the DTD editor window.

Stylus Studio displays an entry field for the element name.

4. Type title and press Enter.

Stylus Studio displays the new element, title, and the element's properties in the Properties window.

Figure 48. New Element in the DTD Editor

5. Click New Modifier .

Stylus Studio displays an entry field for the element's modifier.

6. Double-click Zero or More.

The new modifier is added to the element.

7. Click Add #PCDATA .
8. To define the author element, repeat step 2 through step 7. In step 4, type author instead of title.

When you are done, the Stylus Studio desktop should resemble the following:

i

Figure 49. Creating a DTD with Two Elements

Simple API for XML (SAX)

SAX stands for Simple API for XML - SAX is an XML standard used everywhere in Stylus Studio, for parsing and building representations of XML documents.

Accessing Relational Databases as XML with Stylus Studio's File Explorer

This demonstration is the first part of our series on working with relational and XML data, covering how to use Stylus Studio's File Explorer to connect to and query relational database tables as XML.

Translating XML documents to X12

In-place, via XSLT and via XQuery are all mechanisms supported for converting XML to X12

Consumer Food Products

Want to know what special ingredient is in these consumer food product companies work enviornment? Well it's a touch Stylus Studio that give these consumer food product companies the extra edge they need for producing such high quality food products!

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member