Home >Online Product Documentation >Table of Contents >Defining a complexType in a Sample XML Schema in the Tree View
This topic is part of a sequence that begins with Description of Sample XML Schema.
The steps for defining the PublicationType complexType are described in the following sections:
PublicationType
Stylus Studio displays the XML Schema Editor.
Stylus Studio displays the Tree view of the schema, and the Properties window, which lists the properties for the selected node in the tree.
Stylus Studio displays a field for the new complexType.
bookstoreTree.xsd
In the Tree view, Stylus Studio displays a field for the new attribute.
genre
Stylus Studio displays a drop-down list of built-in simpleTypes.
Stylus Studio displays a drop-down list of group modifiers.
The sequence modifier indicates that an instance document contains zero, one, or more of each child element in the order in which they are defined.
sequence
In the Tree view, Stylus Studio displays a field for the new element definition.
title
subtitle
0
1
The PublicationType complexType must include at least one author element. An author element must include a first-name element and a last-name element.
author
first-name
last-name
Each element that can contain subelements is a complexType. Consequently, to add the author element to the PublicationType complexType, you must first define the authorType complexType. You can then add an element that is of authorType to the PublicationType complexType.
authorType
Schema
unbounded
In the sample XML Schema, you wantPublicationType elements to contain an ISBNnumber, PUBnumber, or LOCnumber element.
ISBNnumber
PUBnumber
LOCnumber
xsd:integer
Stylus Studio displays a message that indicates that the schema is not valid. Click OK in the error box. In the Output Window, you can see the following message:
Validating bookstoreTree.xsd... file://c:\yourDirectory\bookstoreTree.xsd:6,45: Invalid child 'sequence' in the complexType The XML document bookstoreTree.xsd is NOT valid (1 errors)
The problem is that there is a sequence element after an attribute element. The sequence element must come first.
attribute
The definition of the PublicationType complexType is now complete and the schema is now valid.