95.4. The ShellExec command processor
Prev | 95. A generic inclusion command | Next

### 95.4. The ShellExec command processor

This command processor allows to specify a command as you would have typed it in a Terminal (MacOS X, Linux) or in the Command Prompt (Windows).

This command must output a well-formed XML document. The root element of this document is included in the document being edited. If the root element of this document is a `{http://www.xmlmind.com/xmleditor/namespace/clipboard}clipboard` element, then it is all the child elements of the root element which are included in the document being edited.

The command is executed using the directory containing the XML document containing the inclusion as its current working directory. This allows relative filenames referenced in the command-line to be relative to the location of the inclusion.

The following variables are substituted in the command-line:

Variable | Description
--- | ---
`%D`, `%d` | `%D` is the file name of the document being edited. Example: `C:\novel\chapter1.xml`. This variable is replaced by an empty string if the document being edited is found on a remote HTTP or FTP server. `%d` is the URL of the document being edited. Example: `file:///C:/novel/chapter1.xml`.

`%C`, `%c`

`%C` is the name of the directory containing the XXE configuration file where the "`GenericInclusion`" inclusion processor has been declared (by the means of the `inclusionProcessor` configuration element). Example: `C:\Program Files\XMLmind_XML_Editor\addon\config\docbook`.

`%c` is the URL of the above directory. Example: `file:///C:/Program%20Files/XMLmind_XML_Editor/addon/config/docbook`.

Note that this URL does not end with a '`/`'.

`%O` | Specifies the file which will contain the output of the command. If the `%O` variable has been substituted in the specified command-line, then XXE loads the elements to be included from this file. Otherwise, XXE loads the elements to be included from what has been printed by the command on the console (`stdout`).

Example: `"%C/tablerows.pl" -o "%O" ~/.tablerows.cfg`

Prev | Up | Next
95.3. Command processors | Home | 95.5. The Verbatim command processor