1. Dynamic discovery of add-ons

During its startup, the XMLmind XML Editor desktop application recursively scans the contents of its two addon/ directories looking for add-ons.

These two addon/ directories are XXE_install_dir/addon/ and XXE_user_preferences_dir/addon/. More information in What are the two addon/ directories of XMLmind XML Editor?.

The "Quick Start Cache" prevents the dynamic discovery of add-ons

Once the XMLmind XML Editor desktop application has recursively scanned the contents of its two addon/ directories, the results are cached in the "Quick Start Cache".

Therefore the dynamic discovery of add-ons is performed only when the "Quick Start Cache" is empty (or disabled once for all).

The "Quick Start Cache" is automatically cleared when:

Manually clearing the "Quick Start Cache" is normally done by using the Clear button found in OptionsPreferences, Advanced|Cached data in XMLmind XML Editor - Online Help. However it's often quicker to simply delete the XXE_user_preferences_dir/cache/ directory.

An add-on may comprise many different kinds of files. These files must follow the conventions below in order to be dynamically discovered by XXE.

JAR file

A .jar file contains compiled Java™ code.

About JAR files containing native libraries

Some JAR files may contain native libraries. For example: hunspell.dll for Windows 32-bit and libhunspell64.so for Linux Intel™ 64-bit.

When this is the case, it is recommended to create one JAR file per OS/architecture and to give these JAR files filenames following the convention explained below. For example, hunspell.dll should be contained in hunspell--Windows-x86.jar and libhunspell64.so should be contained in hunspell--Linux-amd64.jar.

By doing this, you'll instruct XXE, for example, to ignore hunspell--Linux-amd64.jar and just consider hunspell--Windows-x86.jar when it is started on Windows.

Filename syntax:

jar_basename -> jar_name '--' os_name [ '-' os_arch ]? '.jar'

  • os_name must match the value of Java™ system property os.name (though for Windows, you may skip the "XP", "Vista", "7", "8" suffix and keep just the "Windows" prefix).

  • os_arch must match the value of Java system property os.arch.

Examples:

os_nameos_arch
WindowsIntel 32-bit: x86
Intel 64-bit: amd64
Mac OS XIntel 32-bit: i386
Intel 64-bit: x86_64
LinuxIntel 32-bit: i386
Intel 64-bit: amd64

The deployxxe command-line tool also understands the above filename convention and will wrap these JAR files into appropriate resource elements.

Configuration file

XXE configuration files are XML files:

  • with a file name ending with ".xxe",

  • validated by XML schema with http://www.xmlmind.com/xmleditor/schema/configuration as its target namespace,

  • with a root element named configuration,

  • this root element having a name attribute,

  • containing a detect element.

Several configurations may have the same name. For example, a user may have defined its own configuration named "DocBook" including bundled configuration also named "DocBook" but adding element templates and keyboard shortcuts (see include, elementTemplate, binding). In such case, only one configuration named "DocBook" is kept by XXE: the configuration with highest priority.

Configurations loaded from the addon/ subdirectory of user preferences directory have priority over configurations loaded from the value of environment variable XXE_ADDON_PATH (see below) which in turn have priority over configurations loaded from the addon/ subdirectory of XXE installation directory.

Configurations having the same priority are sorted using their file basenames. Example: file:///opt/xxe/foo/0docbook.xxe is tested before file:///opt/xxe/bar/docbook.xxe when trying to detect the class of a document because 0docbook.xxe lexicographically precedes docbook.xxe.

XML catalogs

XML catalogs are XML files:

  • with a file name ending with "atalog.xml",

  • which conform to the OASIS catalog DTD.

Example:

<?xml version="1.0" ?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD XML Catalogs V1.0//EN"
  "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">

<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"
         prefer="public">

  <public publicId="-//W3C//DTD SVG 1.1//EN"
          uri="common/dtd/svg11/svg11.dtd"/>

</catalog>

Note that specifying the above <!DOCTYPE> will not cause the XML catalog parser to download XML Catalog DTD, catalog.dtd, from the Web.

XXE uses XML Catalogs not only to resolve the locations of the DTD and other external entities, but also to resolve URLs found in the following places:

  • Schema locations in xsi:schemaLocation and in xsi:noNamespaceSchemaLocation.

  • Schema locations in xs:include, xs:redefine, xs:import.

  • Schema locations in <?xml-model href="..."?>.

  • Document locations passed to the document() XPath function.

  • All XXE configuration elements referencing an URL. Example: <include location="..."/>.

  • CSS style sheet locations in @import.

  • CSS style sheet locations in <?xml-stylesheet href="..."?>.

  • XSLT style sheets in the transform child element of a process command.

  • Resources in the copyProcessResource child element of a process command.

  • XSLT style sheets included or imported by other XSLT style sheets (that is, the XML Catalogs used by XXE are passed to Saxon, the XSLT engine bundled with XXE).

  • The href attribute of xi:include elements (XInclude).

Spell-checker plug-ins

Spell-checker plug-ins are contained in Java™ JAR files:

  • with a file name ending with "_spellchecker.jar",

  • implementing service com.xmlmind.xmledit.spellchecker.SpellCheckerFactory.

The exact structure of a plug-in jar (manifest, service providers, etc) is described in Chapter 10, Writing a plug-in in XMLmind XML Editor - Developer's Guide.

XMLmind spell-checker dictionaries

XMLmind spell-checker dictionaries are themselves add-ons which are contained in Java™ JAR files:

  • with a file name ending with ".dar",

  • having a basename which is the ISO code of a language (e.g. fr, fr-CH, en, en-US, etc).

XSL-FO processor plug-ins

XSL-FO processor plug-ins are contained in Java™ JAR files:

  • with a file name ending with "_foprocessor.jar",

  • implementing service com.xmlmind.foprocessor.FOProcessor.

Image toolkit plug-ins

Image toolkit plug-ins are contained in Java™ JAR files:

  • with a file name ending with "_imagetoolkit.jar",

  • implementing service com.xmlmind.xmledit.imagetoolkit.ImageToolkit.

Virtual drive plug-ins

Virtual drive plug-ins are contained in Java™ JAR files:

  • with a file name ending with "_vdrive.jar",

  • implementing service com.xmlmind.xmleditapp.vdrive.DriveFactory.

Customizations of the GUI of XXE

Such customizations are contained in XML files called customize.xxe_gui and conforming to the "http://www.xmlmind.com/xmleditor/schema/gui" W3C XML Schema.

Such GUI specification files are described in XMLmind XML Editor - Customizing the User Interface.

If during its start-up, XXE finds several customize.xxe_gui files, it will merge their contents with the base GUI specification (by default, xxe-gui:DesktopApp.xxe_gui, which is a resource contained in xxe.jar).