There are three types of selection in XXE:
text selection (also called character selection),
node selection (a node is either a named element or an anonymous text node or an anonymous comment node or an anonymous processing instruction node),
implicit element 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 mouse | Using the keyboard |
---|---|
|
|
The node selection is unique to XML editors.
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 mouse | Using the keyboard |
---|---|
|
|
Procedure for selecting a node range using the mouse:
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.
Shift-Ctrl-click on the last node of the selection.
If there is no ambiguity, you can even Shift-Ctrl-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
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.
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.
The implicitly selected element is simply the element containing the caret (also called the insertion cursor).
Being implicitly selected, this element is not drawn 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.
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.
Clicking anywhere in the document view or any caret movement has the side effect to cancel the selection. It is also possible to explicitly do so by typing Esc-Esc.
Menu items:
Selects parent of currently selected node.
If there is no currently selected node, selects the text, comment or processing instruction node containing the caret.
Selects previously selected child of currently selected node.
If there is no such child, selects first child node of currently selected element.
If currently selected node is a text, comment or processing instruction node, cancels the selection.
Selects preceding sibling of currently selected node, if any.
Selects following sibling of currently selected node, if any.
Adds preceding sibling, if any, of currently selected node to the node selection.
If there is no currently selected node, selects the element containing the caret.
Keyboard shortcut (not displayed in menu): Esc-Left.
Adds following sibling, if any, of currently selected node to the node selection.
If there is no currently selected node, selects the element containing the caret.
Keyboard shortcut (not displayed in menu): Esc-Right.
Selects all children of currently selected element.
Keyboard shortcut (not displayed in menu): Esc-Down.
Displays the Find Element dialog box. This dialog box allows to select nodes specified using an XPath expression. This dialog box has a Simple tab which allows to perform most common search tasks without having to learn XPath. Arbitrarily complex XPath expressions are specified using the Advanced tab.