http://www.xmlmind.com/xmleditor Contents Tutorial APPENDIX A: CSS2 properties and values supported by XXE APPENDIX D: Enhancements and bug fixes

5 Command reference

5.1 File->Print

Displays the print dialog box in order to print the explicitly selected element if any, and the whole document otherwise.

Preferences related to printing may be specified in the Print tab of the Options dialog box.

5.2 Search->Replace

searchreplace

The Search/Replace dialog box

The document is searched from caret position to the end of the document.

If replacements are to be performed along with the search and an element has been explicitly selected, the search/replace starts at the beginning of this element, whatever is the position of the caret, and ends at the end of this element. (A backward search/replace starts at the end of the selected element and ends at its beginning.)

Ignore case
The search is case-insensitive. Example: "foo" matches both "foo" and "Foo".
Whole word
The found string must be a word, that is, the found string must be surrounded by white spaces. Example: "foo" matches "foo" but not "foobar".
Regular expression
The searched string must be a valid regular expression.

In such case, $1, $2, ..., $9 may be used in the replacement string to refer to the substrings matching the parenthesized groups of the regular expression.

$0 is replaced by the string matching the regular expression in its entirety. $$ may used to quote character '$'.

Examples:

Backward regular expression search/replace may be slow to the point of being unusable.

Preferences related to searching may be specified in the Search tab of the Options dialog box.

5.3 Tools->CheckSpellingErrors

spellcheck

The Spell Checker dialog box

Tools->CheckSpellingErrors (keyboard shortcut Ctrl-Shift-S) checks the text of the document from the word containing the caret to the end of the document.

If an element has been explicitly selected, the spell checker starts at the beginning of this element, whatever is the location of the caret, and stops at the end of the element.

Note that if the part of the document to be checked contains no spelling errors the dialog box shown above is not displayed at all. Instead message "Found no spelling errors" is displayed at the bottom of XXE window.

"Word:" text field
This text field displays the word for which the spell checker has found an error.

This text field can also be used to modify this word. After editing the word, typing on the Enter key replaces the original word by the modified one.

"Suggestions:" list
This list contains replacement words, if any, suggested by the spell checker.
"Language:" combo box
This combo box may be used to select the language of the dictionary used by the spell checker.

It is possible to switch from a language to another at any time. In such case, the spell checker is automatically restarted with the other dictionary, beginning at the word displayed in the text field.

The last selected language is recorded in the user preference file in order to be automatically chosen in subsequent XXE sessions.

Note that, in this milestone version, the spell checker ignores xml:lang and lang attributes and that it cannot be configured to automatically skip certain types of elements.

"Replace" button
Replaces the original word by the content of the text field.

An empty text field may be used to delete the original word.

"Replace All" button
Replaces all occurrences of the original word by the content of the text field.

This button is disabled for errors different from "Unknown word" or "Improperly capitalized word".

"Ignore" button
Skips the word for which the spell checker has found an error.
"Ignore All" button
Skips all occurrences of the word for which the spell checker has found an error.

This button is disabled for errors different from "Unknown word" or "Improperly capitalized word".

"Learn" button
Records the word in the personal dictionary for currently selected language.

This button is disabled for errors different from "Unknown word".

Personal dictionaries are text files named dict_LL.txt, where LL is an ISO code for a language. These files are created in directory
~/.xxespell
under Unix and in directory
C:\winnt\Profiles\<user>\xxespell
under Windows.

Personal dictionaries are automatically saved when XXE is exited.

5.4 Options->Options

options

The Options dialog box

Guess what spaces
If this toggle is checked, when loading an XML file without a DTD associated to it, whitespace characters are trimmed from elements containing child elements separated by whitespace.

Default: no.

This heuristic is often a good one for XML-data.

Don't use the style sheet
Check this toggle if you always prefer to edit XML using the tree view rather than the CSS styled view.

Default: no.

saveoptions

Encoding
UTF-8 is the default encoding of the XML files created by XXE because this encoding is compact and may be used to represent all Unicode characters.

However, if you need to deliver an XML file created by XXE to a person using a text editor to view or modify it, it is nicer to use a human-readable encoding such as ISO-8859-1 (Western character set). In such case, check the ISO-8859-1 toggle.

Default: UTF-8.

Notes:

Indent
XML files created by XXE are by default not indented because it is faster and safer (no risk to add superfluous whitespace) to do so.

However, if you need to deliver an XML file created by XXE to a person using a text editor to view or modify it, it is nicer to provide this person with an indented XML file:

when DTD
Check this toggle to create indented XML files for documents that have a DTD associated with them. It is always safe to do so.

Default: no.

when no DTD
Check this toggle to create indented XML files for documents without a DTD associated with them. It is not always safe to do so because this option may add superfluous whitespace.

Default: no.

In indented files, elements with an empty content model are saved as (XHTML example) <br /> rather than <br/> and empty elements with a non-empty content model are saved as <p></p> rather than <p/>.

This has been recommended by the W3C to help Web browsers (HTML user agents as they say) to correctly display XHTML. For DTDs other than XHTML, this behavior causes no harm. It even improves the readability of the indented XML files created by XXE.

Indentation
Specifies the number of space characters used to indent a child element relatively to its parent element.

Default: 2.

Max. line length
Specifies the maximum line length for elements containing text interspersed with child elements.

Default: 78.

This number is only used as a hint: XML files created by XXE may contain lines much longer than this number.

printoptions

Screen resolution
Specifies the screen resolution in DPI (Dot Per Inch) used when printing. This resolution directly determines the amount of text a printed page can contain.

Default: 100dpi.

Begin
The page header has 3 areas: begin (the left for left-to-right languages), middle, end (right). This field specifies the text printed at the left of the page header.

Default: empty.

Each area can contain a mix of text and variables:

Variable Description
%F File name of the document being edited
%P Equivalent to "page %I of %C"; see below
%I Current page number
%C Total page count
Middle
Specifies the text printed at the center of the page header.

Default: empty.

End
Specifies the text printed at the right of the page header.

Default: empty.

Color
Specifies the color of the text of the page header.

Default: gray.

Note that the font used for the page header is the default font of the style sheet (see the Style tab below).

Underline [Overline]
Specifies if a thin line is to be printed below the page header [above the page footer].

Default: yes.

editoptions

Max. undo actions
Specifies the maximum number of undo (redo) actions a user will be able to perform. Limited to 100 because a single undo action may consume a great deal of memory.

Default: 10.

When a new element is created...
XXE in its milestone incarnation has no way to specify a template for a newly created element (example: a table that has a head, two rows and two columns). Instead, XXE recursively creates the new element and its children according to the minimum valid content specified by the DTD.

This option specifies how a new element is recursively created when the content type for this type of element has several possible choices for the child elements.

DocBook example: the new element to be inserted is a figure.

<!ELEMENT figure ((title,titleabbrev?),(literallayout|programlisting|
programlistingco|screen|screenco|screenshot|synopsis|cmdsynopsis|
funcsynopsis|classsynopsis|fieldsynopsis|constructorsynopsis|
destructorsynopsis|methodsynopsis|address|blockquote|graphic|
graphicco|mediaobject|mediaobjectco|informalequation|informalexample|
informalfigure|informaltable|indexterm|beginpage|link|olink|ulink)+)>
Do not make a choice
Inserts a figure with a title but no body.

With this option, the newly created element may be invalid. Therefore, use this option if you really know what you are doing.

Use first choice
Inserts a figure with a title and a literallayout.
Make choice based a heuristic
Inserts a figure with a title and a link.

The, very questionable, heuristic selects the text container with the shortest name. This is the default value for this option.

searchoptions

Text boundaries
Searching string "Hello world!" in an XML document is not as obvious as it seems: for example, is "Hello world!" with word "Hello" contained in an emphasis element followed by #PCDATA " world!" supposed to be found by XXE?

This behavior can be specified by choosing one of the 3 following modes (each mode corresponds to a radio button in the Search tab):

  1. Smart mode: "Hello world!" is found within "<em>Hello</em> world!" but not within
    "<p>Hello </p><p>world!</p>".

    This mode uses the DTD to recognize logically contiguous text across different types of elements.

    A text search behaves as if 2 linefeed characters have been inserted after each contiguous piece of text. It is therefore possible using regular expression "\n\n" to find and visualize these text boundaries in the document.

  2. Dumb mode A: there are no boundaries around a #PCDATA whatever the type of the element containing it.
  3. Dumb mode B: a #PCDATA is separated from other #PCDATA whatever the type of the element containing it.

Default: mode 1.

Ignore case
Default value for check box Ignore case of the Search/Replace dialog box (see Search->Replace).

Default: yes.

Whole word
Default value for check box Whole word of the Search/Replace dialog box (see Search->Replace).

Default: no.

Regular expression
Default value for check box Regular expression of the Search/Replace dialog box (see Search->Replace).

Default: no.

styleoptions

These preferences parameterize the CSS style sheet used to visualize the document or to print it.

Setting some of these preferences will have no visible effect if the style sheet author has specified the corresponding properties in the style sheet. For example, if the user preferred background is specified in the Style pane as being light yellow and if the style sheet author has specified the root element background-color as being white, the document will be rendered with a white background.

Serif font family
Specifies the font family used for property value font-family:serif.

Default: Serif (the Java default serif font family).

SansSerif font family
Specifies the font family used for property value font-family:sans-serif.

Default: SansSerif (the Java default sans-serif font family).

Monospaced font family
Specifies the font family used for property value font-family:monospace.

Default: Monospaced (the Java default monospaced font family).

Default font family
Specifies the default value for property font-family.

Default: SansSerif.

Default font size
Specifies the default value for property font-size.

Default: 12pt.

Default background
Specifies the default value for property background-color.

Default: white.

Default text color
Specifies the default value for property color.

Default: black.

5.5 Options->Non-XMLFormats

5.5.1 Using XXE to edit non-XML structured formats

XXE can be used to edit non-XML structured formats like HTML, Javadoc(TM) comments, APT, /etc/passwd, /etc/printcap, http.conf (the Apache configuration file), etc, if plug-ins are provided for such structured formats.

A format plug-in works by converting the data on the fly from the non-XML format to XML when loading a document and by converting them back to the non-XML format each time the document is saved.

XXE relies on the file name extension to find out which plug-in is needed to load a document. Documents whose file name extension has not been associated with any format plug-in are loaded as XML (unless downloaded from a http server which returns the MIME type of the document).

XXE is bundled with two format plug-ins: one for Javadoc and one for APT. See below for a description of these plug-ins.

5.5.2 Registering a format plug-in with XXE

Before being able to load a non-XML document into XXE, the user needs to register the corresponding plug-in with the application.

The format plug-ins bundled with XXE are automatically registered the first time the user starts XXE. You may need to manually register these plug-ins before being able to use them if you have an existing XXE user preference file (for example if you have upgraded your XXE distribution). The XXE user preference file is stored in file ~/.xxe under Unix and in file C:\winnt\Profiles\<user>\xxe.ini under Windows NT.

Procedure:

  1. Exit from XXE.
  2. A format plug-in is contained in one or several .jar files. Copy these .jar files in a place where the Java runtime can find and load them (i.e. ``put them in the Java CLASSPATH'').
  3. Restart XXE.

    These first 3 steps are not needed for the bundled plug-ins.

  4. Use menu command Options->Non-XMLFormats. A dialog box is displayed:

    nonxml

    The dialog box used to register a format plug-in with XXE

  5. Click on the Add button. An input dialog box is displayed requesting you to enter the name of the format plug-in.
  6. Enter the format plug-in name exactly as specified in its documentation.
    Example: com.xmlmind.javadocformat.Format for the Javadoc plug-in.
  7. Click in the list on the format plug-in name to display information about it. If the plug-in has parameters, the Configure button is enabled, otherwise this button is ``grayed''.
  8. If possible, click on the Configure button to set the parameters of the plug-in. A dialog box is displayed:

    nonxmlparam

    The dialog box used to configure a format plug-in

    Note that the plug-in parameters are documented in this dialog box.

5.5.3 The Javadoc plug-in

javadocview

A Java file as displayed by XXE

This plug-in adds Javadoc(TM) support to XXE.

It must be registered as com.xmlmind.javadocformat.Format.

The intended audience for this plug-in is Java programmers and Javadoc writers. With XXE and this plug-in, it becomes possible to edit the Javadoc comments contained in a Java file using a word processor-like view. Writing Javadoc this way is less tedious (no manual formatting of comment lines) and is no longer error-prone (DTD-directed editing).

This plug-in has full support for all Javadoc 1.3 tags plus most of HTML 3.2 tags.

The following HTML 3.2 tags and attributes are not supported:

The Javadoc 1.3 tags are modeled in XML as follows:

javadocdtd

The file name extension required for a ``Javadoc document'' is .java.

Unlike Web browsers, this plug-in is not designed to load broken HTML 3.2. However, this plug-in can help Javadoc writers to easily spot and fix the HTML errors contained in Javadoc comments. See next section for a real world case study.

javadocerror

the Javadoc plug-in refuses to load Sun's String.java for the above reason

When XXE refuses to load a Java file, an error dialog is displayed with

Try to guess what the error message means and fix the problem using your favorite text editor (use xmleditor-support@xmlmind.com if you are really stuck), then reload the Java file into XXE.

Warning: before using this plug-in for the first time, please take the time to configure it properly to make sure that its newline and tab policies are compatible with yours.

5.5.3.1 Applying the Javadoc plug-in to Sun JDK 1.3.1 sources

The Javadoc plug-in has been tested on all the Java sources given by Sun for the Linux JDK 1.3.1.

The plug-in has succeeded to load 1750 out of 1877 Java files. It has failed 127 times generally for the following reasons:

Note that all the errors described above are impossible to do if XXE is used to edit the Javadoc comments.

Having succeeded to load a Java file into XXE does not mean that this file is valid: 45 out the 1750 loaded files were found having validity problems.

Generally these validity problems are minor and are caused by missing attributes or invalid attribute values. It is possible to quickly fix them by using menu command Tools->CheckValidity.

5.5.4 The APT plug-in

This plug-in adds APT (Almost Plain Text) format support to XXE.

It must be registered as com.xmlmind.aptformat.APTFormat.

APT is a text format for technical articles which is simple, structured, tag-less, and which is convertible to HTML, XHTML, PDF, RTF, PostScript, SGML or XML DocBook using the Open Source tool called aptconvert. Aptconvert can be downloaded from http://www.pixware.fr/.

The file name extension required for an APT document is .apt or .txt.