# Adding global elements

A global element is an element with a global scope. It is one that has been declared as part of the main schema rather than as part of a content model.

The following instructions were written for the Resource perspective, but they will also work in many other perspectives.

To add a global element, complete the following steps:

1. Open your XML schema in the XML schema editor.
2. In the Outline view, select your schema. The entire schema and its contents are displayed in the Design view.
3. In the Design view, right-click in the Elements section and click Add Element.
4. In the Properties view, click the General tab, and type a new name for the global element in the Name field.
5. In the Properties view, you can select the attribute type from the predefined list in the menu next to the Type field.

   Alternatively, you can select Browse from the list for more options.

   The Set Type dialog box appears, and lists all built-in and user-defined types currently available. You can change the Scope of the list by selecting one of the following options:
   - Workspace: lists all of the types available in your workspace.
   - Enclosing Project: lists all of the types available in the project that contains your file.
   - (Default) Current Resource: list all of the types available in your current file.
   - Working Sets: list all the types available within the selected working set.

   Select the type you want in the type list, then click OK.

6. Click the Advanced tab. In this page, you can specify the following various values for the global element:
   - Abstract: click true if you want the global element to be abstract. When a global element is declared to be abstract, it cannot be used in an instance document. Instead, a member of that global element's substitution group must appear in the instance document.
   - Block: determines whether the global element may be replaced by an element derived from it.
   - Final: determines whether this global element may be derived from.
   - Substitution Group: a substitution group allows elements to be substituted for other elements.
   - Nillable: select true if you do not want the global element to be able to have any child elements, only attributes.
7. Click the Documentation tab to provide any information about this global element. The Documentation page is used for human readable material, such as a description.
8. Click the Extensions tab to add application information elements to your annotations of schema components. The Extensions page allows you to specify the schema and add XML content to your annotations.

You can add a content model to a global element, which is the representation of any data that can be contained inside the global element. For more information about working with content models, refer to the related tasks.
Related tasks
Adding content models
Adding element references