History | Edit

Figure: The xs:element Component

Defines an element. An element declaration is an association of a name with a type definition, either simple or complex, an (optional) default value and a (possibly empty) set of identity-constraint definitions. See more info at http://www.w3.org/TR/xmlschema11-1/#element-element.

An element by default displays the following properties when rendered in the diagram: default, fixed, abstract and type. When referenced or declared locally, the element graphical representation also contains the value for the minOccurs and maxOccurs properties (for 0..1 and 1..1 occurs the values are implied by the connector style) and the connectors to the element are drawn using dotted lines if the element is optional.

Table 1. xs:element Properties
Property Name Description Possible Values Mentions
Name The element name. Always required. Any NCName for global or local elements, any QName for element references. If missing, will be displayed as '[element]' in diagram.
Is Reference When set, the local element is a reference to a global element. true/false Appears only for local elements.
Type The element type. All declared or built-in types. In addition, the following anonymous types are available: [ST-restriction], [ST-union], [ST-list], [CT-anonymous], [CT-extension SC], [CT-restriction SC], [CT-restriction CC], [CT-extension CC]. For all elements. For references, the value is set in the referenced element.
Base Type The extended/restricted base type. All declared or built-in types For elements with complex type, with simple or complex content.
Mixed Defines if the complex type content model will be mixed. true/false For elements with complex type.
Content The content of the complex type. simple/complex For elements with complex type that extends/restricts a base type. It is automatically detected.
Content Mixed Defines if the complex content model will be mixed. true/false For elements with complex type that has a complex content.
Default Default value of the element. A default value is automatically assigned to the element when no other value is specified. Any string The fixed and default attributes are mutually exclusive.
Fixed A simple content element may be fixed to a specific value using this attribute. A fixed value is also automatically assigned to the element and you cannot specify another value. Any string The fixed and default attributes are mutually exclusive.
Min Occurs Minimum number of occurrences of the element. A numeric positive value. Default value is 1 Only for references/local elements
Max Occurs Maximum number of occurrences of the element. A numeric positive value. Default value is 1 Only for references/local elements
Substitution Group Qualified name of the head of the substitution group that this element belongs to. All declared elements. For XML Schema 1.1 this property supports multiple values. For global and reference elements
Abstract Controls whether or not the element may be used directly in instance XML documents. When set to true, the element may still be used to define content models, but it must be substituted through a substitution group in the instance document. true/false For global elements and element references
Form Defines if the element is "qualified" (belongs to the target namespace) or "unqualified" (doesn't belong to any namespace). unqualified/qualified Only for local elements
Nillable When this attribute is set to true, the element can be declared as nil using an xsi:nil attribute in the instance documents. true/false For global elements and element references
Target Namespace Specifies the target namespace for local element and attribute declarations. The namespace URI may be different from the schema target namespace. This property is available for local elements only. Not editable property. For all elements.
Block Controls if the element can be subject to a type or substitution group substitution. '#all' blocks any substitution, 'substitution' blocks any substitution through substitution groups and 'extension'/'restriction' block any substitution (both through xsi:type and substitution groups) by elements or types, derived respectively by extension or restriction from the type of the element. Its default value is defined by the blockDefault attribute of the parent xs:schema. #all, restriction, extension,substitution, extension restriction, extension substitution, restriction substitution, restriction extension substitution For global elements and element references
Final Controls whether the element can be used as the head of a substitution group for elements whose types are derived by extension or restriction from the type of the element. Its default value is defined by the finalDefault attribute of the parent xs:schema. #all, restriction, extension, restriction extension, [Empty] For global elements and element references
ID The component ID. Any ID For all elements.
Component The edited component name. Not editable property. For all elements.
Namespace The component namespace. Not editable property. For all elements.
System ID The component system ID. Not editable property. For all elements.