Contents
Index
Search

29. spellCheckOptions

<spellCheckOptions
  useAutomaticSpellChecker = boolean
  languageAttribute = list of QNames
  defaultLanguage = language
  checkComments = boolean
  checkedProcessingInstructions = list of Names
  checkedAttributes = list of XPath (subset)
  skippedElements = list of XPath (subset)
/>

Specifies, on a per document type basis, options for the spell checker. Used by both the automatic (AKA on-the-fly) and the ``traditional'' spell checkers.

useAutomaticSpellChecker

If true, the automatic spell checker must be automatically activated each time a document of that type is opened.

Default: false; see language lookup.

This setting may be overridden by the user with OptionsPreferences, Tools/Spell section, Automatic Spell Checker radio buttons.

languageAttribute

Specifies which attributes specify the language of an element and all its descendants. This is typically xml:lang or lang (or both in the case of XHTML).

Default: there is no such attribute; see language lookup.

defaultLanguage

Specifies the default language of a document of that type. (This option is rarely used.)

Default: no default language; see language lookup.

[Note]

XMLmind XML Editor determines the language of an element by examining, in that order:

  1. The value of any of the attributes specified by option languageAttribute.

    Attribute xml:lang is used by default when the document being spell-checked is not associated to any configuration file or when its configuration file does not contain a spellCheckOptions element having a languageAttribute attribute.

    Note that the attribute lookup starts at current element and ends at the root element of the document.

  2. The value of option defaultLanguage if any.

  3. The value selected in the Default language combobox of the Spell tool.

checkComments

Specifies whether comments must be checked for spelling.

Default: do not check comments.

checkedProcessingInstructions

Specifies the targets of processing instructions which must be checked for spelling. May be an empty list, which means: do not check processing instructions.

Default: do not check processing instructions.

checkedAttributes

Specifies the XPaths (subset) of attributes which must be checked for spelling. May be an empty list, which means: do not check attributes.

For efficiency reasons, an XPath whose last step does not test an attribute name is ignored. For example, "foo/@*" is ignored.

Default: do not check attributes.

skippedElements

Specifies the XPaths (subset) of elements which must be automatically skipped by the spell checker. May be an empty list, which means: do not skip any element.

For efficiency reasons, an XPath whose last step does not test an element name is ignored. For example, "foo//*" is ignored.

Default: do not skip any element.

Examples (DocBook 4, XHTML):

cfg:spellCheckOptions xmlns=""
  useAutomaticSpellChecker="true"
  languageAttribute="lang"
  skippedElements="address funcsynopsisinfo classsynopsisinfo 
                   literallayout programlisting screen synopsis" />

<cfg:spellCheckOptions xmlns:html="http://www.w3.org/1999/xhtml"
  useAutomaticSpellChecker="true"
  languageAttribute="xml:lang lang"
  skippedElements="html:pre html:style html:script" />

Note that a spellCheckOptions element does not replace the spellCheckOptions element previously found in a configuration file. When a configuration file contains several spellCheckOptions elements, these spellCheckOptions elements are merged.

Example:

<cfg:spellCheckOptions xmlns=""
    useAutomaticSpellChecker="true"
    languageAttribute="xml:lang lang"
    skippedElements="html:pre html:script" />
        .
        .
        .
<cfg:spellCheckOptions xmlns=""
    languageAttribute="xml:lang"
    defaultLanguage="en-US"
    checkComments="true"
    checkedProcessingInstructions="annotation remark"
    checkedAttributes="@alt html:table/@summary html:table/@title" />

is equivalent to:

<cfg:spellCheckOptions xmlns=""
    useAutomaticSpellChecker="true"
    languageAttribute="xml:lang"
    defaultLanguage="en-US"
    checkComments="true"
    checkedProcessingInstructions="annotation remark"
    checkedAttributes="@alt html:table/@summary html:table/@title"
    skippedElements="html:pre html:script">