XML Type Editor

Overview

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:

XML Type Editor Overview

 

 

Create a New Type

  1. Right-click in the Types tab, the select Create New Type
  2. In the Create New Type dialog, you need
    1. Name: Specify the name of the newly created type
    2. Based on: Check if you want your new type to inherit from another type.
      1. Extension: Allow additional attributes and elements to appear.
      2. Restriction: Disallow some elements, attributes, or values that the base type permits. 

 

Edit an Existing Type

The Types tab describes the structure of a type. You can add the following elements to the structure of a type.

Element: Element  A complex element is an XML element that contains other elements and/or attributes.
Element Group: ElementGroupReference The group element is used to define a group of elements to be used in complex type definitions.
Sequence: Sequence 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.
Choice: Choice 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.

Name: Specifies a name for the element. This attribute is required if the parent element is the schema element.
Type: Optional. Specifies either the name of a built-in data type, or the name of a simpleType or complexType element.
Min Occurs: 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.
Max Occurs: 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.
Default: Optional. Specifies a default value for the element (can only be used if the element’s content is a simple type or text only).
Fixed: Optional. Specifies a fixed value for the element (can only be used if the element’s content is a simple type or text only).
Description: Optional. Describes the element in natural language.

The Attributes tab describes an element’s attributes.

SOURCE: Specifies the attribute’s owner.
ID: Specifies a unique ID for the attribute.
TYPE: 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.
USE: Optional. Specifies how the attribute is used. Can be one of the following values:

  • optional – the attribute is optional (this is default)
  • prohibited – the attribute cannot be used
  • required – the attribute is required
DEFAULT: Optional. Specifies a default value for the attribute. Default and fixed attributes cannot both be present.
FIXED: Optional. Specifies a fixed value for the attribute. Default and fixed attributes cannot both be present.
DESCRIPTION: Optional. Describes the attribute in a natural language.
RESTRICTED VALUES: Optional. Restrictions are used to define acceptable values for XML attributes.