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

## 23. spellCheckOptions

    <spellCheckOptions
      useAutomaticSpellChecker = boolean
      languageAttribute = QName
      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 attribute, if any, specifies the language of an element and all its descendants. This is typically `xml:lang` or `lang`.

  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 the attribute 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, XHTML/RELAX NG):

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

      <cfg:spellCheckOptions xmlns=""
        useAutomaticSpellChecker="true"
        languageAttribute="xml:lang"
        skippedElements="pre style script" />

      <cfg:spellCheckOptions xmlns:html="http://www.w3.org/1999/xhtml"
        useAutomaticSpellChecker="true"
        languageAttribute="xml: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"
        skippedElements="pre script" />
            .
            .
            .
    <cfg:spellCheckOptions xmlns=""
        languageAttribute="xml:lang"
        defaultLanguage="en-US"
        checkComments="true"
        checkedProcessingInstructions="annotation remark"
        checkedAttributes="@alt table/@summary table/@title" />

is equivalent to:

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

Prev | Up | Next
22.1. Relationship between `schematron` and `validateHook` | Home | 24. spreadsheetFunctions