Adding global attributes

A global attribute is an attribute that can be recognized anywhere in a document. Once declared, a global attribute can be referenced in one or more declarations using an attribute reference.

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

To add a global attribute, complete the following steps:

  1. Open your XML schema in the XML schema editor.
  2. In the Design view, right-click in the Attributes section and click Add Attribute.
  3. In the Properties view, enter a name for the attribute in the Name field.
  4. 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 will appear, 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.

  5. Click the Documentation tab if you want to provide any information about this global attribute. The Documentation page is used for human readable material, such as a description.
  6. Click the Extensions tab if you want 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.