2.1. Custom engine options

2.1.1. Using property configuration_name.pasteFromWord.parameter

Command pasteFromWord is passed a parameter mainly containing engine options. This command is generally invoked from a menu item. Rather than replace the menu item by another one invoking Command pasteFromWord with a different parameter, suffice to define property configuration_name.pasteFromWord.parameter containing this different parameter. When property configuration_name.pasteFromWord.parameter is defined, command pasteFromWord ignores its normal parameter and uses the value of this property instead.

For example, let's suppose we want "Paste from Word" to generate HTML tables rather than CALS tables. This is done by suppressing the following two engine options from the original parameter of command pasteFromWord:

-p tables.set-column-number yes
-p transform.cals-tables yes

See original parameter in addon_install_dir/docbook5/docbook5.incl.

Hence your customization file should contain (excerpts from samples/custom_docbook5/0docbook5.xxe):

<property name="$c.pasteFromWord.parameter">1
  [xmlns:db=http://docbook.org/ns/docbook]
  [after db:para]

  [xmlns:pfw=java:com.xmlmind.xmleditext.paste_from_word.XPathFunctions]

  -p sections.max-level {pfw:docbookSectionMaxLevel(.)}

  -t paste-from-word:xslt/docbook5.xslt

  -p transform.hierarchy-name
  {if($pasting-root, local-name(/*), pfw:docbookHierarchyName(.))}
</property>

1

Notice the use of the $c variable. This variable is automatically substituted with the name of the configuration containing the configuration element.