Michael A. Nachbaur


Apache::AxKit::Language::SpellCheck - XML Text Spell Checker


    AxAddStyleMap text/x-spell-check Apache::AxKit::Language::SpellCheck

    Alias /spell/ /path/to/docroot
    <Location /spell/>
        SetHandler axkit
        AxAddProcessor text/x-spell-check NULL

    SetHandler axkit
    AxAddProcessor text/xsl           /stylesheets/scrub-xml.xsl
    AxAddProcessor text/x-spell-check NULL
    AxAddProcessor text/xsl           /stylesheets/display-html.xsl


This language module processes an incoming XML document, either loaded from disk or returned from the previous pipeline stage, and processes its text nodes with Text::Aspell. It injects additional XML elements in the document representing which words are incorrectly spelled, and optionally offers spelling suggestions.

The XML elements injected into the source document appear similar to the following, though without the exta whitespace.

  <sp:incorrect xmlns:sp="http://axkit.org/2004/07/17-spell-check#">


The following options can be used to change the default behavior of this language module:


  PerlSetVar AxSpellLanguage fr

Use this directive to change the language you wish to use when checking spelling. Defaults to "en_US".


  PerlSetVar AxSpellSuggestions 5

Indicates the maximum number of spelling suggestions to return. This defaults to 3. If set to 0, then no suggestions are ever returned.


  PerlSetVar AxSpellSkipElements "h1 title {http://www.w3.org/1999/02/22-rdf-syntax-ns#}RDF"

Informs the spell checking processor to skip any text contained within the specified XML elements. If you need to specify a namespace URI for an element, then prefix the element's local name with the namespace URI, enclosed in curly-braces "{}".


  • Doesn't process attribute text

  • Has no facility for specifying alternate spelling databases


AxKit, Text::Aspell

Hosting generously
sponsored by Bytemark