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 |
---|---|
|
|
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.
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 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-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
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 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.
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. |