%@ page language="C#" masterpagefile="~/templates/Documentation.master"
inherits="Page"
pagetitle="Defining a complexType in a Sample XML Schema in the Tree View"
keywords="Defining a complexType in a Sample XML Schema in the Tree View"%> 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
This topic is part of a sequence that begins with Description of Sample XML Schema.
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.
This topic is part of a sequence that begins with Description of Sample XML Schema.
In the Tree view, Stylus Studio displays a field for the new attribute.
Stylus Studio displays a drop-down list of built-in simpleTypes.
This topic is part of a sequence that begins with Description of Sample XML Schema.
Stylus Studio displays a drop-down list of group modifiers.
The
In the Tree view, Stylus Studio displays a field for the new element definition.
Stylus Studio displays a drop-down list of built-in simpleTypes.
This topic is part of a sequence that begins with Description of Sample XML Schema.
In the Tree view, Stylus Studio displays a field for the new element definition.
Stylus Studio displays a drop-down list of built-in simpleTypes.
This topic is part of a sequence that begins with Description of Sample XML Schema.
The
Each element that can contain subelements is a complexType. Consequently, to add the
Stylus Studio displays a field for the new complexType.
This topic is part of a sequence that begins with Description of Sample XML Schema.
In the sample XML Schema, you want
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:
Defining a complexType in a Sample XML Schema in the Tree View
PublicationType complexType are described in the following sections:
Defining the Name of the Sample complexType in the Tree View
To define a complex type in the sample XML Schema:
.
.
PublicationType as the name for this new complexType and press Enter.
.
bookstoreTree.xsd, and click Save.
Adding an Attribute to a Sample complexType in the Tree View
To add the genre attribute to the PublicationType complex type:
.
genre as the name of the new attribute and press Enter.
Adding Elements to a Sample complexType in the Tree View
To add the title element, which must appear exactly once, to the PublicationType complex type:
.
sequence modifier indicates that an instance document contains zero, one, or more of each child element in the order in which they are defined.
.
title as the name of the new element and press Enter.
Adding Optional Elements to a Sample complexType in the Tree View
To add the optional subtitle element to the PublicationType complex type:
.
subtitle as the name of the new element and press Enter.
0 and press Enter
1 and press Enter.
Adding an Element That Contains Subelements to a complexType in the Tree View
PublicationType complexType must include at least one author element. An author element must include a first-name element and a last-name element.
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.
To define the authorType complex type:
Schema node.
.
authorType as the name for this new complexType and press Enter.
.
.
authorType.
Now you can add the author element to the PublicationType complex type:
.
1 and press Enter.
unbounded in the Max Occur. field and press Enter.
Choosing the Element to Include in the Sample complexType in the Tree View
PublicationType elements to contain an ISBNnumber, PUBnumber, or LOCnumber element.
To specify this:
.
.
ISBNnumber as the name of the new element and press Enter.
xsd:integer and press Enter.
PublicationType.
PUBnumber element and once for the LOCnumber element.
.
The problem is that there is a sequence element after an attribute element. The sequence element must come first.
The definition of the PublicationType complexType is now complete and the schema is now valid.