Declaring Elements
Elements are declared using the element element.
Example
The following example shows an element declaration for Software
.
<xs:element name="Software" />
Referencing a Global Element Declaration
If you declare the complex type for this element at the top of the document (global declaration), you can reference this element in the remainder of the schema using the ref attribute.
Example
The following example shows an element declaration for Software
element.
<xs:element name="Software" />
<xs:complexType>
<xs:element name="title" />
<xs:element name="company" />
</xs:complexType>
</xs:element>
The following example shows a reference to the global element declaration for the Software
element.
<xs:element name="Catalog">
<xs:complexType>
<xs:element ref="Software">
</xs:complexType>
</xs:element>
Elements without a type defined will take a ur-type definition.