4. Anatomy of a configuration file
Prev | Chapter 2. Writing a configuration file for XXE | Next

## 4. Anatomy of a configuration file

File `dtd_section_config/section.xxe` contains:

    <configuration name="Simple Section (DTD)"
      xmlns="http://www.xmlmind.com/xmleditor/schema/configuration"
      xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration">

      <detect>
        <dtdPublicId>-//XMLmind//DTD Simple Section//EN</dtdPublicId>
      </detect>

      <template location="template.xml" name="Empty Section" />

      <include location="common.incl" />

    </configuration>

- A configuration file must conform to the ``configuration.xsd`` W3C XML schema.

- A configuration file must have an "`xxe`" extension.

- The `configuration` root element must have a `name` attribute. This name must be chosen in order to uniquely identify the configuration among all the other configurations.

- The `configuration` element must have a `detect` child element (see below).

- Support configuration files (such as `common.incl`; see above) may be included in the `.xxe` main file. However such support configuration files must not have "`xxe`" extensions and their `configuration` root elements must not have `name` attributes.

- The `.xxe` main configuration file along with all support files (`.incl`, `.css`, `.xsd`, `.rng`, `.dtd`, `*catalog.xml`, `.xsl`, icons, etc) must be created in a subdirectory itself contained in one of the two XXE `addon/` directories (more information about these `addon/` directories in Section 1, “Dynamic discovery of add-ons”).

  For example, it could be created in the `addon/` subdirectory of XXE user preferences directory. XXE user preferences directory is:

  - ``$HOME`/.xxe5/` on Linux.

  - ``$HOME`/Library/Application Support/XMLmind/XMLEditor5/` on the Mac.

  - ``%APPDATA%`\XMLmind\XMLEditor5\` on Windows XP, Vista, 7 and 8.

    Example: `C:\Documents and Settings\john\Application Data\XMLmind\XMLEditor5\` on Windows XP. `C:\Users\john\AppData\Roaming\XMLmind\XMLEditor5\` on Windows Vista, 7 and 8.

    If you cannot see the "`Application Data`" directory using Microsoft Windows File Manager, turn on Tools>Folder Options>View>File and Folders>Show hidden files and folders.

The `configuration.xsd` schema is found in the add-on called "XMLmind XML Editor Configuration Pack". This means that you can quickly and safely your configuration file using XXE (using menu item File → New and then selecting entry "XMLmind XML Editor Configuration|Empty Template") or you can create your configuration file using any text editor and from time to time validate your configuration as follows:

    C:\> XXE_install_dir\bin\xmltool validate¬
        -s xxe_config_pack_install_dir/config/xsd/configuration.xsd¬
        my_config.xxe my_include1.incl my_include2.incl

More information about the xmltool command line utility in The xmltool command-line utility.

Prev | Up | Next
3. Before writing your first configuration | Home | 5. Specifying which configuration to use for a given document type