4.3. Attributes tool
Prev | 4. Tools | Next

### 4.3. Attributes tool

- There are two methods for adding or changing the attributes of the (explicitly or implicitly) selected element:

  1. Using the attribute form (the upper side of the attribute tool).This should be the method of choice for persons who prefer to use the keyboard.

  2. Using the attribute table (the lower side of the attribute tool). This should be the method of choice for persons who prefer to use the mouse.

- The ``minus'' button of the attribute form can be used to remove an attribute. Removing an attribute directly from the attribute table is possible too: simply right-click on the attribute row and use the popup menu.

- Adding an attribute for an element of the unconstrained type must be done using the attribute form. Simply type the name and value of the attribute in the attribute form and click on the OK button (or press Enter in the value field).

- Adding an attribute that matches an attribute wildcard must be done using the attribute form. Simply type the name and value of the attribute using the attribute form and click on the OK button (or press Enter in the value field). XXE will of course check that the name you have typed conforms to the attribute wildcard.

#### 4.3.1. Using the attribute table

The content of the attribute table can be described as follows:

- All attributes set for the selected element are displayed by the table.

- All possible attributes for the selected element, even those not set, are also displayed by the table.

  Attributes which have not been set are displayed in gray. Attributes which have been set are displayed in black.

- Attributes are listed sorted in alphabetical order.

- The names of required attributes are displayed using a bold font.

- The names of fixed attributes are displayed using an italic font.

Procedure for adding an attribute or changing its value:

1. Click on the field at the right of the attribute name. This field is editable.

2. Type the value of the attribute.

   If the attribute type is enumerated, this field is a menu rather than a text field, so you can directly choose the value of the attribute without having to type anything.

3. Press Enter to commit the change.

Procedure for removing an attribute:

1. Right-click on the row of the attribute to be removed.

2. Select the Remove item in the displayed popup menu.

#### 4.3.2. Using the attribute form

Procedure for adding an attribute or changing its value:

1. Type the name of the attribute in the name field (first field of the form).

2. Press Enter to move to the value field (second field of the form).

3. Type the value of the attribute in the value field.

4. Press Enter in the value field to commit the change. This also gives the keyboard focus back to the document view.

### Tip

Both the name and value fields support auto-completion. However auto-completion in the value field only works for attributes having the following types: any enumerated type, `ID`, `IDREF`, `IDREFS`.

This auto-completion feature can be configured using the Options dialog box.

Procedure for removing an attribute:

1. Select the attribute by either clicking on it in the attribute table or by typing its name in the name field (first field of the form).

2. Press Enter to move to the value field (second field of the form).

3. Click on the Remove attribute button.

Procedure for adding an attribute to an element of the unconstrained type:

1. Type any attribute name in the name field (first field of the form).

   ### Note

   If the namespace of the attribute name has not been declared, you will have to declare it using Tools|Declare Namespace before being allowed to add the attribute.

2. Type the value of the attribute in the value field (second field of the form).

3. Press Enter in the value field to commit the change. This also gives the keyboard focus back to the document view.

Procedure for adding an attribute that matches an attribute wildcard:

1. Type an attribute name that matches the wildcard in the name field (first field of the form).

   ### Note

   If the namespace of the attribute name has not been declared, you will have to declare it using Tools|Declare Namespace before being allowed to add the attribute.

2. Type the value of the attribute in the value field (second field of the form).

3. Press Enter in the value field to commit the change. This also gives the keyboard focus back to the document view.

   XXE will of course check that the name you have typed conforms to the attribute wildcard.

The attribute form contains the following buttons:

Remove attribute

  Removes selected attribute if this attribute is not required.

  Clicking on this button with the right mouse button displays a popup menu which allows the user to force the removal of a required attribute.

  Using such command is sometimes needed for RELAX NG grammars specifying content models with an elaborate mix of attributes and child elements.

Add or change attribute

  Commits the changes. Analogous to pressing Enter in the value field.

Cancel

  Cancels the non-committed changes and clears the attribute form. Analogous to typing Esc in the name or value field.

List of Values

  Displays a dialog box which can be used to choose a value for the attribute being edited. The value specified using this dialog box is directly assigned to the attribute.

  Specialized helper dialog boxes are displayed for attributes of

  - any enumerated type,

  - `ID`, `IDREF`, `IDREFS` types,

  - `hexBinary` and `base64Binary` types.

  For all other types of attributes, a very simple multi-line editor is displayed. This may be useful to view or edit attribute values which are too long to be comfortably viewed or edited using the value field.

  Note that in the case of the dialog box displayed for enumerated types and ID or IDREF types, a single click is sufficient to select a value from the displayed list. Also note that the text field above the list supports auto-completion.

Browse Files

  Displays a file chooser dialog box. The URL or file name specified using this dialog box is is directly assigned to the attribute.

  Clicking on this button with the right mouse button displays a popup menu with eight radio buttons allowing to choose between:

  - Open or save files.

  - File or directories.

  - Absolute or relative paths (relative paths are relative to the location of the element being edited).

  - URL or plain file names.

  The choices made using these radio buttons are persistent during the editing session (but not across editing sessions like, for example, user preferences specified using the Options dialog box).

Prev | Up | Next
4.2. Include tool | Home | 4.4. Search tool