Chapter 10. The basics Previous topic Parent topic Child topic Next topic

A few things you need to learn before starting to use XMLmind XML Editor Web Edition (XXEW for short).
XXEW is quite straightforward to use but you simply cannot guess how it works. While what you see resembles your typical word processor, XXEW does not work like a word processor, nor like a text editor, neither like other XML editors. Therefore this chapter is really a must read. (Corresponding screencast.png 5min screencast Opens in new window.)

Basic concepts

  • Patterns looking like this text_placeholder.png are text placeholders. You can click into (or tab to) such placeholders and start typing.
  • The node path bar, found above the document view, indicates what is selected or when there is no explicit selection, the element containing the caret.
    nodepathbar_and_placeholder.png
  • XXEW has 2 different kinds of selection, the text selection and the node selection.
    1. The text selection, which is given a pink background color, works like in any word processor or text editor. Few editing commands apply to the text selection: paste.png Paste, convert.png Convert. For example, you can convert the text selection to a bold or italic inline element.
      textsel.png
    2. The node selection looks different than the text selection: a thin red frame is drawn around the selected nodes. The simplest way to select a node is to click on its name in the node path bar.
      nodepathbar_and_nodesel.png
      Most editing commands apply to the node selection.
      The node selection may comprise several sibling nodes, for example, two contiguous paragraphs. The easiest way to extend the node selection is to Shift-click before or after the thin red frame.
  • The element directly containing the caret is always implicitly selected: no thin red frame around it.
    For example if you want to insert a table before a paragraph, first click inside this paragraph (but not inside any of its child elements, as this would implicitly select the child element) then use insertBefore.png Insert Before.
    However, if you want to insert a list after a table, you cannot do that using the implicit element selection because a table cannot directly contain some text. You'll have to first explicitly select this table (e.g. by clicking on "table" in the node path bar) then use insertAfter.png Insert After.
  • Notice that the two editing commands mentioned above are insertBefore.png Insert Before, insertAfter.png Insert After. XXEW also has less commonly used insert.png Insert editing command.
    insertBefore.png Insert Before
    Insert an element (or a text node) just before the node selection.
    insert.png Insert
    Insert an element right here, at caret position.
    insertAfter.png Insert After
    Insert an element (or a text node) just after the node selection.
    Note
    Note
    Note that XXEW does not work like other XML editors. In other XML editors,
    • Insert Before often means "Insert somewhere before selection".
    • Insert often means "Insert somewhere inside selection".
    • Insert After often means "Insert somewhere after selection".
  • For the same reasons, XXEW has 3 paste commands and not just one: pasteBefore.png Paste Before, paste.png Paste, pasteAfter.png Paste After. Unlike insert.png Insert, paste.png Paste is commonly used and works as expected by replacing the text or node selection with the contents of the clipboard.
  • When XXEW, which is a strictly validating XML editor, does not allow you to perform the editing command you want, it's almost always because you didn't select the right element and/or you are not using the right editing command.
    For example, you have clicked inside a paragraph and attempt to use insert.png Insert to add a section after it. This cannot work because a paragraph cannot contain a section. Instead, first select the section which is the ancestor of the paragraph (e.g. click "section" in the node path bar) then use insertAfter.png Insert After (not insert.png Insert) and select "section" from the list.

Basic editing commands

What are the basic editing commands and where to find them?
The contextual menu of the node path bar
In XXEW, most basic editing commands are invoked by selecting an entry of the contextual menu of the node path bar. While clicking an element name or node type (e.g. "#text") in the node path bar just explicitly selects this element or node, right-clicking not only selects this element or node but also displays a contextual menu containing all the basic editing commands.

Figure 10-1. The contextual menu of the node path bar

nodepathbar_and_menu.png
The contextual menu of the text or node selection
Right-clicking inside the text selection (having a pink background color) or explicit node selection (inside the thin red frame) displays a contextual menu containing all the basic editing commands.

Figure 10-2. The contextual menu of the text or explicit node selection

selection_and_menu.png
Note that right-clicking in the document view when there is no text or explicit node selection displays the contextual menu of the web browser. This contextual menu is only useful for fixing a spell-checking mistake using the spell-checker of the web browser.
The toolbar
The left side of the toolbar is fixed and contains all the editing commands which are generic, that is, not specific to a given document type (e.g. DocBook, DITA Topic, XHTML). Moreover clicking pop-se.png, a small button found at the left of the Edit label, displays a menu which contains even more generic commands.

Figure 10-3. The left side of the toolbar and its popup menu

toolbar_edit_menu.png
Commands undo.png Undo, redo.png Redo, copy.png Copy, cut.png Cut, delete.png Delete are found in all editors and will not be described here. Commands pasteBefore.png Paste Before, paste.png Paste, pasteAfter.png Paste After and commands insertBefore.png Insert Before, insert.png Insert, insertAfter.png Insert After have already been discussed in the previous section.
replace.png Replace
Replace the node selection by a new, empty, element or text node. A dialog box is displayed to let the user choose this new element or text node ("#text").

Figure 10-4. The same element chooser dialog box is used for the Insert Before, Insert, Insert After, Replace, Convert and Wrap commands

element_chooser_dialog.png
convert.png Convert
Replace the text or node selection by an element containing this text or node selection. Example 1: select a paragraph and use Convert to convert it to a program listing. Example 2: make a text selection mixing text and inline elements and use Convert to convert it a bold inline element.
wrap.png Wrap
This command is a variant of Convert. The only difference between Wrap and Convert is that, with Wrap, when a single element is selected, the selected element is given a new parent element. Example(1): select a paragraph and use Wrap to give it a note parent.
editAttribute.png Edit Attributes
Displays a dialog box which may be used to add, remove and change the attributes of implicitly or explicitly selected element.
textSearchReplace.png Search/Replace
Expands/collapses the text search/replace pane which is part of the toolbar.

Figure 10-5. The text search/replace pane is revealed after clicking "Search/Replace"

text_search_replace_pane.png
repeat.png Repeat
Repeats last repeatable command. See Repeat some of the commands you have already executed.
commandHistory.png Command History
Displays a dialog box listing last repeatable commands from newest to oldest.
Copy as Text
Copies as plain text —just the characters, not the elements— the explicit text or node selection to the clipboard.
split.png Split
Splits explicitly selected element in two parts, the split point being specified by caret position.
Tip
Tip
Commands Split and Join are rarely used because for most document types pressing Enter, Backspace and Delete mimic the behavior corresponding keystrokes in a word processor and thus may be used to split and join elements. Examples:
  • Pressing Enter inside a paragraph or a list item splits this element in two parts.
  • Pressing Backspace at the beginning of a paragraph or a list item joins this element to the preceding paragraph or a list item.
  • Pressing Delete at the end of a paragraph or a list item joins this element to the following paragraph or a list item.
join.png Join
Joins explicitly selected element to its preceding sibling, an element of same type. This gives a single element containing the child nodes of the two joined elements. This command is the inverse command of Split.
Comment sub-menu
Sub-menu containing commands which may be used to insert a comment node at caret position and to insert a comment before or after selected node.
Processing instruction sub-menu
Sub-menu containing commands which may be used to insert a processing instruction node at caret position, to insert a processing instruction before or after selected node and to change the target of a processing instruction.
declareNamespace.png Declare Namespace
Displays a dialog box letting the user declare a namespace, change the prefix of a namespace or make a namespace the default namespace.
Note
Note
If the current document is conforming to a DTD, the dialog box lets the user view the namespaces and their prefixes but not modify them.
styles.png Change Stylesheet
Displays a dialog box letting the user choose an alternative CSS stylesheet for the styled view or on the contrary, no stylesheet at all, that is, switch to the tree view.

Adding images to your document

  1. Use insertBefore.png Insert Before, insert.png Insert, insertAfter.png Insert After or, easier, the figure.png Picture button often found in the right side of the toolbar to add an element representing an image to your document.
    The image element will be inserted into your document but at first, you'll only see blue_picture_icon.png, the blue image placeholder icon.
    Note
    Note
    An image placeholder icon is given different colors and different tooltips in order to explain its presence:
    blue_picture_icon.png Blue
    Image file not yet specified.
    green_picture_icon.png Green
    Image file specified but could not be displayed, either because the image format is not supported (e.g. EMF) or because the document being edited was opened from a local file (see note about local images).
    red_picture_icon.png Red
    An error occurred when attempting to display the image. The image tooltip contains an error message.
  2. Specify an image file. There are 3 different methods to do this.
    Double click or right-click the image placeholder icon
    The quickest way to do this is to double click or right-click the image placeholder icon (or the image itself if an image file has already been specified). This invokes the "Change Image" command which changes the image file of an image element.
    1. You'll first be prompted to choose an image file. The image file chooser being displayed by the "Change Image" command depends on whether the document being edited was opened from a local file or from a remote file.

      Figure 10-6. The local image file chooser dialog box

      choose_local_image_dialog.png

      Figure 10-7. The remote image file chooser dialog box

      choose_remote_image_dialog.png
    2. You'll then be prompted to specify whether the chosen image file is to be referenced by the image element or to be embedded(2) in the document.

      Figure 10-8. The "Change Image" dialog box

      change_image_dialog.png
    Alternatively, drop an image file onto the image placeholder icon
    Alternatively, drag an image file and drop it onto the image placeholder icon (or the image itself if an image file has already been specified). This also invokes the "Change Image" command, sparing you the effort of choosing an image file using a dialog box.
    Note
    Note
    When the document being edited was opened from a remote file, this method is the only way to add to your document an image coming from a local file.
    Alternatively, specify the attribute of the image element pointing to the image file
    Alternatively:
    1. Click inside the image placeholder icon (or the image itself if an image file has already been specified) to select the corresponding image element. The node path bar will show you the name of this element. This image element depends on the type of the document being edited: DITA Topic <image>, DocBook <imagedata>, XHTML <img>.
    2. Use editAttribute.png Edit Attributes to specify the attribute pointing to the image file. This attribute depends on the type of the document being edited: DITA Topic <image>/@href, DocBook <imagedata>/@fileref, XHTML <img>/@src.
    Note
    Note
    When the document being edited was opened from a local file, there is no way to display an image file specified this way. This has already been explained in note about local images. However, after using this method, the blue image placeholder icon blue_picture_icon.png will turn to green green_picture_icon.png.

 (1) In this example, we'll assume that case a note must contain paragraphs hence a paragraph may not be converted to a note.
 (2) Not recommended for document size and possible interchange problem reasons.