2.6. Tools menu

Declare Namespace

Displays Declare Namespace dialog box.

If the current document is conforming to a DTD, the dialog box allows to view the namespaces and their prefixes but not to modify them.

Edit Attribute

Displays Attributes tool.

Check Validity

Displays Validity tool, unless no validity errors are found in current document, in which case an OK message is displayed in the status bar.

This command is disabled if current document is not constrained by a grammar.

Tip

Current document validity is automatically checked each time the document is saved, therefore unless you are fixing an invalid document you don't really need to explicitly use this command.

Check Spelling

Displays the Spell tool, unless no spelling errors are found in current document[8], in which case an OK message is displayed in the status bar.

Automatic Spell Checker

Toggle used to activate and deactivate the automatic (AKA on-the-fly) spell checker. See also option "Activate if this is specified in the configuration file".

This menu item is present only in XMLmind XML Editor Professional Edition.

Execute Command

For advanced users only. Displays a dialog box which allows to choose a command by name. This is needed when a command is not bound to a keystroke, menu item or tool bar button. Example: command convertCase (see Section 13, “convertCase” in XMLmind XML Editor - Commands). This facility is especially useful when recording a macro-command.

2.6.1. Helper Application menu

This menu contains entries allowing to use third-party applications to view or edit part or all of the document being edited.

Open Element or Attribute Content in Helper Application

Requires an element to be implicitly or explicitly selected. Displays a dialog box allowing the select this element or one of its attributes from a list.

Opens specified element or attribute in a third-party ``helper'' application. If the helper application cannot be determined automatically (because it has not yet been registered using the Preferences dialog box, Helper Applications section), the user is prompted to specify it.

Example of use: use your web browser to open the page referenced in the url attribute of the (DocBook 4) ulink element.

Edit Element or Attribute Content in Helper Application

Same as above except that the helper application is assumed to be an editor. If this editor is used to modify the element or attribute, then the changes are also automatically applied to the document being edited.

This command works as follows: let's suppose the element of interest contains an image encoded using base 64 (data type xs:base64Binary).

  1. This command examines the first bytes of the image and, using this signature, determines which helper application to use.

  2. If the helper application cannot be determined (because it has not yet been registered using the Preferences dialog box, Helper Applications section), the user is prompted to specify it.

  3. It reads the image data from the element, decodes it and saves it to a temporary file.

  4. It starts the helper application, an image editor, passing it the file containing the extracted image.

  5. After the user quits the image editor, the command detects whether the extracted image has been modified and, if this is the case, reloads it in the element.

Examples of use: use GIMP to edit the image file referenced in the src attribute of the (XHTML) img element. Use Inkscape to edit the svg:svg element contained in an (DocBook 5) imagedata element.

Open Document in Helper Application

Opens the document being edited in a third-party ``helper'' application. If the helper application cannot be determined automatically (because it has not yet been registered using the Preferences dialog box, Helper Applications section), the user is prompted to specify it.

This entry is disabled if the document is newly created and has not yet been saved. Also note that this command is guaranteed to fail if the document is stored on the Windows file system and is currently write-locked by XMLmind XML Editor.

Example of use: use your web browser to preview the XHTML document being edited.

Edit Document in Helper Application

Same as above except that the helper application is assumed to be an editor. XMLmind XML Editor will automatically reload the document after the third-party editor is used to modify it.

This entry is disabled if the document is newly created and has not yet been saved. Also note that this command is guaranteed to fail if the document is currently write-locked by XMLmind XML Editor.

Example of use: use your favorite text editor to perform some low-level modifications on the XML document being edited.

2.6.2. Spreadsheet menu

This menu is available only in XMLmind XML Editor Professional Edition, where it is hidden by default. You need to enable it by checking "Enable the Integrated Spreadsheet Engine" in OptionsPreferences, Features section.

Show Table Labels, Hide Table Labels

Makes tables look like spreadsheets by adding A1-style labels to their columns and to their rows. This is very useful when you want to type cell references such as A1:C3 in a formula.

Insert/Edit Formula

If a formula (xxe-formula processing instruction) is explicitly selected, a specialized formula editor is opened to allow the user to modify the formula.

Otherwise, a specialized formula editor is opened to allow the user to insert a new formula at caret position. Inserting a new formula in an empty element works too: simply explicitly select this empty element and use this menu item.

Disable Selected Formulas, Enable Selected Formulas

Disables/enables all the formulas (xxe-formula processing instruction) found in the explicit node selection or in the text selection.

Disabling a formula means passivating it. That is, it is no longer used to update the document. In some cases, this is a handy alternative to removing it.

Tip

In the styled view, formulas are represented by a small F icon. Clicking on this icon with the middle button of the mouse allows to switch the state of the formula from enabled to disabled and vice-versa.

Remove Selected Formulas

Remove all the formulas (xxe-formula processing instruction) found in the explicit node selection or in the text selection.

Clear External Document Cache

Clears the cache of external documents accessed by formulas.

Formulas can access external documents using XPath escapes (example: `document("tutorial/VATrates.html#france_vat",.)`). Such access is generally slow and therefore, documents need to be cached the first time they are loaded.

However, the cache is not very smart and will often not be able to detect changes in the external document. This problem will happen if the change happens in a module included by the document or if the document is stored on a remote HTTP or FTP server. In this is case, disabling the cache and also disabling the auto-update mode are recommended.

See also Spreadsheet options.

Auto-update Mode

This toggle may be used to switch from auto-update mode to manual update mode.

In manual update mode, only newly inserted formulas are computed. To force a full calculation, the user has to explicitly use the Update command below.

In auto-update mode, a full calculation is automatically performed, if needed to, when the editing context changes. For example: type some text in a paragraph, then click in (or tab to) another paragraph to trigger a spreadsheet calculation.

Note that in both modes, a full calculation is automatically performed, if needed to, before validating or saving the document.

Using manual update mode is recommended if you have a slow computer or if you have inserted a lot of formulas in your document or if your formulas access many external documents.

See also Spreadsheet options.

Update

Forces a full calculation of the spreadsheet.

2.6.3. "Record Macro" menu

This menu allows to record a sequence of commands and to replay the recorded sequence at will.

This facility used in conjunction with SelectFind Element facility or with the Search tool may be seen as an advanced, versatile, yet simple to use, form of search/replace.

Start

Starts recording a sequence of commands.

Stop

Stops recording the sequence of commands.

Cancel

Cancels the recording of a sequence of commands.

View

Displays a dialog box containing recorded macro in XML form. Very handy to paste it in an XXE configuration file (see Section 2, “command” in XMLmind XML Editor - Configuration and Deployment).

Replay

Replays recorded sequence of commands.

Procedure 1. Procedure for recording a sequence of commands

  1. Use the Start menu item.

  2. Invoke commands as usual: use key bindings, menu items and tool bar buttons.

    Typing some text is of course supported. ``Tabbing'' from a text node to another is supported too.

    The following tools can also be used during a recording: Edit, Attributes, Search, Characters.

    If you use the Search tool during a recording, just use the search part; do not use the replace part. And after the searched string is found and selected, click on the Stop button of the Search tool to give keyboard focus back to the document view. This will allow you to continue adding more commands to the recorded sequence.

  3. Use the Stop menu item.

Only editing commands can be recorded. That is, commands that modify the contents and/or the selection marks of the document being edited. Actions such as FileOpen or ViewAdd cannot be recorded.

At most 20 commands can be recorded. Typing contiguous characters, no matter how many, counts as a single command.

Attempting to record the following commands will automatically cause macro recording to be canceled:

  • any command triggered by a mouse click,

  • Undo, Redo, Repeat,

  • any command which fails (example: searching a string and this string is not found),

  • any command which cannot be executed given current editing context (example: pasting some text to a place where the schema forbids to do so).

Recording interactive command such as Insert After works as expected: it is the command along with the element interactively chosen by the user which is recorded, and not the interactive invocation of Edit+Insert After (i.e. which activates the Edit tool or which displays the equivalent dialog box).

Recording command Execute Command is fully supported and works as expected: it is the command executed by ToolsExecute Command which is recorded, and not the invocation of ToolsExecute Command.



[8] By default, spell checking starts at the current caret position, but this can be changed by turning off the "Start from current caret position" option of the Spell tool.