Complex types describe the permitted content of an element, including its element and text children and its attributes. A complex type definition consists of a set of attribute uses and a content model. The types of content model include element-only content, in which no text may appear (other than whitespace, or text enclosed by a child element); simple content, in which text is allowed but child elements are not; empty content, in which neither text nor child elements are allowed; and mixed content, which permits both elements and text to appear. A complex type can be derived from another complex type by restriction (disallowing some elements, attributes, or values that the base type permits) or by extension (allowing additional attributes and elements to appear).
XML Type Editor in Workgroup works as follows:
The Types tab describes the structure of a type. You can add the following elements to the structure of a type.
|A complex element is an XML element that contains other elements and/or attributes.
|The group element is used to define a group of elements to be used in complex type definitions.
|The sequence element specifies that the child elements must appear in a sequence. Each child element can occur from 0 to any number of times.
|XML Schema choice element allows only one of the elements contained in the declaration to be present within the containing element.
The Definition tab describes an element’s properties.
|Specifies a name for the element. This attribute is required if the parent element is the schema element.
|Optional. Specifies either the name of a built-in data type, or the name of a simpleType or complexType element.
|Optional. Specifies the minimum number of times this element can occur in the parent element. The value can be any number >= 0. Default value is 1. This attribute cannot be used if the parent element is the schema element.
|Optional. Specifies the maximum number of times this element can occur in the parent element. The value can be any number >= 0, or if you don’t want to set a limit on the maximum number, use the value “unbounded”. Default value is 1. This attribute cannot be used if the parent element is the schema element.
|Optional. Specifies a default value for the element (can only be used if the element’s content is a simple type or text only).
|Optional. Specifies a fixed value for the element (can only be used if the element’s content is a simple type or text only).
|Optional. Describes the element in natural language.
The Attributes tab describes an element’s attributes.
|Specifies the attribute’s owner.
|Specifies a unique ID for the attribute.
|Optional. Specifies a built-in data type or a simple type. The type attribute can only be present when the content does not contain a simpleType element.
|Optional. Specifies how the attribute is used. Can be one of the following values:
|Optional. Specifies a default value for the attribute. Default and fixed attributes cannot both be present.
|Optional. Specifies a fixed value for the attribute. Default and fixed attributes cannot both be present.
|Optional. Describes the attribute in a natural language.
|Optional. Restrictions are used to define acceptable values for XML attributes.