An element is a named piece of information, or a field, within a message, with a meaning agreed by the applications that create and process the message.
An element has a specific meaning agreed by the applications that create and process the message. For example, a message might include a string that your applications have agreed is a 'Customer Name'. An element is always based on a type, either simple or complex.
An element:
Elements can be simple or complex. A simple element is a single, named piece of information such as 'Age' or 'Customer Name'. A simple element is based on a simple type which defines its content.
A complex element is a named structure containing other elements. A complex element named 'Customer Details' might contain the simple elements 'Age' and 'Customer Name'. A complex element can also contain other complex elements. A complex element is based on a complex type, which defines its content and structure.
Elements can be global or local. A global element can be used in several different messages, or even in several places within the same message. It must be given a unique name by which it can be referenced. A local element is defined in one position within one complex type or group, and is not available for reuse elsewhere in the message model.
Elements can be defined as optional, mandatory and repeating using the properties Min Occurs and Max Occurs. For further information, see Cardinality: optional, repeating and mandatory elements.
An element can be given a default value, so that if no value is supplied by the input message, the default will be used. Alternatively, a fixed value can be defined, and the element will always take that value.
An element's value can be constrained using value constraints which define the range of legal values for the element. The value constraints are actually associated with the simple type on which the element is based. For further information, see Message model objects: simple types.
An element can be marked as a valid substitute for another element by using the substitution group property on the element. In this way groups of elements can be assembled where any of the elements in the group can substitute for one element, the head element. For further information, see Substitution groups in the message model.
In the message definition file, an element is modeled using an XML Schema element declaration, as described in XML Schema Part 0: Primer. Fixed and default values are modeled using a value constraint on the element. Other types of constraint are applied by using facets on the element's type.
For details about XML Schema, see XML Schema Part 0: Primer on the World Wide Web Consortium (W3C) Web site.