## Restructuring Documents

### Changing type

To change the type of an existing element, select it and choose the new type in the XHTML or XML menus, or in the XHTML palette. You can change that way a numbered list (ol) into an unnumbered list (ul) or a paragraph into a heading or a list.

Element types offered by the submenus Information type and Character element of the XHTML menu work as toggles. If you select some plain text and activate one of these commands, the selected text will be turned into an element of the chosen type. Conversely, if you select an element of a type listed in these submenus and you activate the corresponding menu item, the element is removed from the document, but its content is kept.

### The Transform Command

The Transform command from the Edit menu performs complex structure transformations, based on a language that specifies how a given structural pattern can be transformed into different structures. For example, nested lists can be transformed into a table and back again.

#### Available Transformations

The available transformations are defined in the file `Amaya/amaya/HTML.trans`. Please refer to the document "Using the HTML.trans file" for a description of the language in which the transformation rules are written.

Additional transformations may be specified in the HTML.trans file. Some transformations are provided in the HTML.trans file as examples.

#### Using the Transform CommandTo use this command:

1. Choose Transform from the Edit menu.

   Amaya displays a menu that lists all the transformations that can be applied to the current selection.

2. Choose the transformation you want.

### Inserting a Division

You can easily group a set of paragraphs, headings, lists, tables, and so on within a division. To do this, select the elements you want to group, and then select Division (div) from the XHTML menu.

### Merging Elements

You can merge successive elements, even if they are not at the same level in the document structure, by using the `Backspace` and `Delete` keys. When the insertion point is at the end of an element, use the `Delete` key to merge; when it is at the beginning of an element, use the `Backspace` key. In both cases, these keys do not delete any characters; instead they merge elements previously separated by a structure boundary.

Note that when the insertion point is within an element, the `Backspace` and `Delete` keys delete the next or previous character as usual.