Show Table of Contents
2.6. Defining elements
Elements in XML Schema represent an instance of an element in an XML document generated from the schema. The most basic element consists of a single
element element. Like the element element used to define the members of a complex type, they have three attributes:
name— A required attribute that specifies the name of the element as it appears in an XML document.type— Specifies the type of the element. The type can be any XML Schema primitive type or any named complex type defined in the contract. This attribute can be omitted if the type has an in-line definition.nillable— Specifies whether an element can be omitted from a document entirely. Ifnillableis set totrue, the element can be omitted from any document generated using the schema.
An element can also have an in-line type definition. In-line types are specified using either a
complexType element or a simpleType element. Once you specify if the type of data is complex or simple, you can define any type of data needed using the tools available for each type of data. In-line type definitions are discouraged because they are not reusable.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.