101 ways to select nodes

XMLmind XML Editor supports text selection as well as node selection.

There is little to say about text selection because it works as expected in any text editor or word processor. For example, Shift-button1 extends the text selection to the location clicked upon, Shift-Down_Arrow extends the selection to the next line, Ctrl+Shift-Left_Arrow extends the selection to the next word, etc.

You have already learned in the previous lessons that moving the caret into a text node implicitly selects the element containing this text node. You have also learned that clicking in the node path bar on an element name (e.g. "section") or a node name (e.g. "#text") explicitly selects the corresponding node. When a node is explicitly selected, a red box is drawn around it. When an element is implicitly selected, there is no visual clue that something is selected.

However, there are other ways to select nodes, either by using the keyboard or by using the mouse. If you want to be more productive with XMLmind XML Editor, you need to learn some of these other methods.

Mac users

Select a node

Using the keyboard Using the mouse
  • Ctrl-Up_Arrow selects the parent of selected node.

    If there is no explicit node selection, this hotkey selects the text node containing the caret.

  • Ctrl-Down_Arrow selects the last selected child of selected element.

    That is, pressing repeatedly Ctrl-Up_Arrow and then pressing repeatedly Ctrl-Down_Arrow, works as expected.

  • Ctrl+Shift-Up_Arrow selects the preceding sibling of selected node.
  • Ctrl+Shift-Down_Arrow selects the following sibling of selected node.
  • Ctrl-button1 selects the node clicked upon.

    Repeating this action without moving the mouse selects its parent, then its grand-parent, etc.

  • Click on the non-editable ``decor'' which has been generated for an element: the bullet of a list item, the number of a section, the image contained in a figure, the border of a table, etc.

Extend the node selection

Some of the commands of XMLmind XML Editor (e.g. Paste, Replace, Convert) can be applied to a node range. What we call a node range here is one or more consecutive sibling nodes. A node range may comprise different types of nodes: element, text node, comment, processing-instruction. What counts is that all the nodes have the same parent element and are consecutive.

Using the keyboard Using the mouse
  • Esc Right_Arrow (means: press Esc then press Right_Arrow) extends the selection to the following sibling of selected node.

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

  • Esc Left_Arrow extends the selection to the preceding sibling of selected node.
  • Esc Down_Arrow selects all the children of the selected element.
  • Shift-button1 extends the node selection, if any, to the node clicked upon.

Cancel the text or node selection

Using the keyboard Using the mouse

Esc Esc (means: press Esc then press Esc again).

Click inside any text node to cancel the explicit selection.

Watch the screencast Watch the screencast