Chapter 6. The element manager

Table of Contents
6.1. The Insert tab
6.2. The Rename tab
6.3. The All tab
6.4. The Attributes tab
6.5. Attribute list
6.6. Railroad diagrams

The element manager in the bottom part of the left pane provides the most important functions for working with the elements inside your document. It consists of four tabs to select the primary content of the element manager and a row of command buttons.

The element manager is normally visible, but it can be hidden to enlarge the space that is available for the element tree and the document window. The status of the element manager (hidden or visible) is shown by the Element manger button in the toolbar:

The element manager is currently visible and can be disabled by clicking this button in the toolbar.

The element manager is currently hidden and can be enabled by clicking this toolbar button.

If the element manager is visible, it is always displayed to the left of the document window. If the element tree is shown, the element manager will be displayed below the element tree. If the element tree is hidden, the element manager will occupy the complete height of the pane to the left of the document window.

Figure 6-1. The element manager

The tabs in the element manager are labeled Insert, Rename, All, and Attributes. To select one of the element manager tabs, click on the title of the tab to bring it in front.

Insert

The Insert tab contains all elements that can be inserted at the current location or around the selected text.

Rename

The Rename tab shows all elements to which the current element can be renamed.

All

The All tab holds a list of all elements that are defined in the DTD of your document.

Attributes

The Attributes tab shows the attributes and attribute values of the current element.

The row of command buttons at the bottom of the element manager is used to display information about the selected entry in the element manager and to perform the action associated with the front tab. The command buttons change according to the element manager tab in front.

 Element Information

Display the definition of the selected element. This is the definition as it occurs in the DTD with the exception that parameter entities are fully expanded and replaced by their content. This button is not present in the Attributes tab.

  Railroad diagram

Display a railroad diagram of the selected element (not available in the Attributes tab). Railroad diagrams help in visualizing the structure of an element as it is defined by the DTD. Please refer to Raildroad diagrams for more information about railroad diagrams.

  Declare element

Declare a new element. This is only possible in well-formed XML documents. The button is not available in the Attributes tab. It is disabled for valid XML and SGML documents because the available elements are defined by the DTD for such documents.

 Attribute list

Display attribute information about the selected element. This button displays a dialog with information about all attributes of the selected element. It not available in the Attributes tab of the element manager.

 Style sheet

Display the style sheet for the selected element. Not available in the Attributes tab

 Insert Element

Insert the selected element. This button is only present in the Insert tab of the element manager.

 Rename Element

Rename the current element to the selected element. This button is only present in the Rename tab of the element manager.

 Attribute Information

Display information about the selected attribute. This button is only available in the Attributes tab.

  Delete Attribute

Delete the currently selected attribute. This button is only available in the Attributes tab.

 Declare Attribute

Declare a new attribute. This button is only available in the Attributes tab. It is disabled for SGML and valid XML documents where the attributes are defined by the DTD.

6.1. The Insert tab

The insert tab (shown in Figure 6-1) contains a list of all elements that can be inserted at the current location of the insertion cursor or around the currently selected region of the document.

If no text is selected, this list contains the elements that can be inserted at the current location of the insertion cursor. If a region of text is selected, the insert tab contains all elements that can be inserted around the selected region.

The content of the insert tab is modified when the insertion cursor moves into another element or when a region of text is selected or deselected.

To insert a new element into your document, follow these steps:

Inserting a new element

  1. Position the insertion cursor at the location where you want to insert the new element.

  2. Choose Element->Insert to display the Insert tab of the element manager or click on the title of the Insert tab in the element manager.

  3. Select the desired element name from the list in the insert tab of the element manager.

  4. Press the Return key or click on the button in the element manager.

  5. A new element will be created in your document window and the insertion cursor will be moved into the new element.

Tip: Instead of using the menu commands, you can switch to the Insert tab of the element manager by using the Ctrl-i hot-key.

For faster navigation to an element name, you can type the first character of the element name after activating the Insert tab. Typing a character in the insert tab will select the first element name that starts with that character, typing the character again will select the second element name that starts with that character, and so on.

Instead of pressing the return key or clicking on the insert button, you can double-click the element name in the list of available elements.

If a new element that does allow character data has been inserted, the keyboard focus will remain in the element manager to simplify insertion of other elements. To return to the document window, press the Ctrl-i key to make the cursor reappear in your document or click in the document window. If the new element can contain character data, the keyboard focus will automatically move back to the document window.

You can insert new elements only if their insertion is allowed by the DTD and if they can occur at the current location in your document.

You cannot insert new elements outside of the document element or at locations where elements would not be recognized, e.g. inside of a CDATA section.