2.1. The selection in XXE

There are three types of selection in XXE:

2.1.1. Text selection

The text selection is the type of selection supported by all text editors and word processors.

It is, of course, possible to select text across document nodes.

Selected text is displayed as characters drawn over a pink background.

The text selection can be seen as a way to specify a range of characters and descendant nodes contained in a common ancestor node. The copy, cut, delete, paste, convert commands will copy, delete or replace the specified characters and descendant nodes.

  • Example 1: "<p>This is our <img src="logo.png"> new logo.</p>". Selected text starts at "This" and ends after "new" and is to be deleted.

    This delete operation gives "<p> logo.</p>".

  • Example 2: "<p>This is <em>great</em>, really!</p>". Selected text starts at "This" and ends after "great" and is to be converted to <strong>.

    This convert operation gives "<p><strong>This is <em>great</em></strong>, really!</p>".

How to select text in XXE:

Using the mouseUsing the keyboard
  • Click at the beginning of the text selection and drag the mouse to the end of selection.

  • Shift+Left or Shift+Right extends the text selection by one character.

  • Ctrl+Shift+Left or Ctrl+Shift+Right extends the text selection by one word.

  • Ctrl+Shift+Home extends the text selection to the beginning of the line.

  • Ctrl+Shift+End extends the text selection to the end of the line.

  • Shift+Down or Shift+Up extends the text selection by one line.

As expected, Shift-click may be used to extend the text selection. However if there is a node selection (see below), Shift-click will extend the node selection instead.

2.1.2. Node selection

The node selection is unique to the XML editor.

In XXE, you can even select several nodes at the same time if these nodes are consecutive children of the same parent (contiguous range of child nodes).

Selected nodes are displayed with a thin red border around them.

How to explicitly select a single node in XXE:

Using the mouseUsing the keyboard
  • Click on the node.

    If some text is near the place where you have clicked, it will ``attract'' the caret and the node will not be selected. In such case, you are forced to Ctrl-click instead of simply clicking.

  • Or Ctrl-click on the node.

    Ctrl-click several times (without moving the mouse) if needed to. Each Ctrl-click will select the parent of currently selected node.

    Do not Ctrl-click several times too fast otherwise the editor will think you are double-clicking or triple-clicking and therefore, selecting elements that way would not work.

  • Or click on generated content such as a list bullet or a section number.

  • Or Ctrl-click in the blank space found at the right of the text of a paragraph.

  • Or click on the name of the node you want to select in the Node Path bar.

  • Click inside the node to move the caret there. Type Ctrl+Up until you reach the node you want to select.

    Keep an eye on the Node Path bar while doing this.

  • Or use the Select menu or any of the corresponding keyboard shortcuts Ctrl+Up, Ctrl+Down, Shift+Ctrl+Up or Shift+Ctrl+Down.

Procedure for selecting a node range using the mouse:

  1. Select first node using any of the methods described above.

    Make sure that you have selected the right node by looking at the Node Path bar, otherwise extending the node selection will not work.

  2. Shift-click on the last node of the selection. If there is no ambiguity, you can even Shift-click anywhere past the last node of the selection.

Procedure for selecting a node range using the keyboard:

  • Esc+Down selects all child nodes of explicitly or implicitly selected element.

  • OR

    1. Select first node using any of the methods described above.

      Make sure that you have selected the right node by looking at the Node Path bar, otherwise extending the node selection will not work.

    2. Adjust selected node range: Esc+Right extends node selection to following sibling and Esc+Left extends node selection to preceding sibling.

    Note Esc+Right (and Esc+Left) will first select element containing caret if there is no explicit node selection, therefore typing Esc+Right several times is often the quickest way to select a node range.

2.1.3. Implicit element selection

The implicitly selected element is simply the element containing the caret (also called the insertion cursor).

Being implicitly selected, this element is not drawn with a red border around it but you know it because it is the element which is displayed in the Node Path bar.

All editing commands except the most generic form of Split and Join can be applied to the implicitly selected element.

[Important]

Almost all editing commands do not require you to explicitly select the element you want to act upon. This makes XXE at the same time efficient and easy to use.