In This Topic
Graphical Representation

Summary
An <xs:element> that is defined in a global scope (i.e. its parent is <xs:schema>) can be referenced through out the schema. This provides a mechanism for reuse.
Note: <xs:complexType> is typically am much better mechanism to provide re-use. Globally defined elements indicate that the element can be the root element in an XML Document, so over use of them can be confusing.
Creating
An <xs:element> can be referenced by setting a the type of the <xs:element> to the name of an existing global element. This can be done via the properties panel or the type drop down in the graphical view.
Sample
The following XSD code
<xs:element name="Address">
<xs:complexType>
<xs:sequence>
<xs:element name="Line1" type="xs:string" />
<xs:element name="Line2" type="xs:string" />
<xs:element name="Postcode" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
...
<xs:element name="Customer">
<xs:complexType>
<xs:sequence>
<xs:element ref="Address" />
</xs:sequence>
</xs:complexType>
</xs:element>
Will be represented like this


Sample XML would look like this
<?xml version="1.0" encoding="utf-16"?>
<Customer>
<Address>
<Line1>12 SomePlace St</Line1>
<Line2>Some Town</Line2>
<Postcode>HG27JU</Postcode>
</Address>
</Customer>
Inline Properties
Properties that apply to a type are shown inline at the bottom of the items container.

Values that are inherited from the base types are shown in brackets, values specifically set against the item are shown without brackets.

If a facet is not valid for a given type (typically because of its data type), then its value is shown in red.
Inline properties can be disabled in the
Options.