26. spellCheckOptions
Prev | Chapter 7. Configuration elements | Next

## 26. 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 Options → Preferences, 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`. Note that the attribute lookup starts at current element and ends at the root element of the document,

  2. the value of option `defaultLanguage`,

  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 V4, 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">

Prev | Up | Next
25.1. Relationship between `schematron` and `validateHook` | Home | 27. spreadsheetFunctions