<?xml version='1.0' encoding='ISO-8859-1'?>
<configuration 
  xmlns="http://www.xmlmind.com/xmleditor/schema/configuration"
  xmlns:cfg="http://www.xmlmind.com/xmleditor/schema/configuration">

<!-- =================================================================== -->
<!-- Works in a DocBook 4 document. -->

<binding>
  <keyPressed code="F2" />
  <command name="convertToBold" />
</binding>

<command name="convertToBold">
  <macro repeatable="true" undoable="true" 
         label="Convert to Bold">
    <sequence>
      <command name="convert" 
               parameter="[implicitElement] emphasis" />
      <command name="putAttribute" parameter="role bold" />
    </sequence>
  </macro>
</command>

<binding>
  <keyPressed code="F2" modifiers="shift" />
  <command name="convertToBold" />
</binding>

<command name="convertToBold2">
  <macro repeatable="true" undoable="true"
         label="Convert to Bold">
    <sequence>
      <choice>
        <command name="selectNode" 
                 parameter="self[implicitElement] emphasis" />
        <command name="convert" 
                 parameter="[implicitElement] emphasis" />
      </choice>
      <command name="putAttribute" parameter="role bold" />
    </sequence>
  </macro>
</command>

<!-- =================================================================== -->
<!-- Works in a XHTML document. -->

<binding>
  <keyPressed code="F3" />
  <command name="insertLineBreak" />
</binding>

<command name="insertLineBreak">
  <macro>
    <sequence>
      <command name="insert"
        parameter="into {http://www.w3.org/1999/xhtml}br" />

      <sequence>
        <pass><command name="selectNode"
                parameter="parent {http://www.w3.org/1999/xhtml}p 
                           {http://www.w3.org/1999/xhtml}li 
                           {http://www.w3.org/1999/xhtml}dt 
                           {http://www.w3.org/1999/xhtml}dd 
                           {http://www.w3.org/1999/xhtml}th 
                           {http://www.w3.org/1999/xhtml}td"/></pass>
        <command name="insertNode" parameter="textAfter" />
        <command name="cancelSelection" />
      </sequence>
    </sequence>
  </macro>
</command>

<!-- =================================================================== -->
<!-- Works in a any document. -->

<binding>
  <keyPressed code="F4" />
  <command name="insertCommandOutput" />
</binding>

<command name="insertCommandOutput">
  <macro>
    <sequence>
      <command name="run" />
      <command name="insertString" parameter="%_" />
    </sequence>
  </macro>
</command>

<!-- =================================================================== -->
<!-- Works in a DocBook 4 document. -->

<!-- template(para,PAA.para) is defined in the stock 
     DocBook 4 configuration. -->

<binding>
  <keyPressed code="F5" />
  <command name="insertAfterAs" 
           parameter="#template(para,PAA.para)" />
</binding>

<command name="insertAfterAs">
  <macro>
    <sequence>
      <command name="formatTextAs" parameter="%0" />
      <command name="paste" 
               parameter="after[implicitElement] %_" />
    </sequence>
  </macro>
</command>

<!-- =================================================================== -->
<!-- Works in a DocBook 4 document. -->

<binding>
  <keyPressed code="F6" />
  <command name="insertFamousUlink" />
</binding>

<command name="insertFamousUlink">
  <macro undoable="true" label="Insert Favorite">
    <sequence>
      <command name="pick" 
               parameter="Favorites true
                          W3C
                          http://www.w3.org/
                          'DocBook Home Page'
                          http://www.docbook.org/
                          Java
                          http://www.java.com/" />
      <set variable="url" expression="%_" plainString="true" />

      <command name="insert" parameter="into ulink" />

      <get expression="$url" />
      <command name="putAttribute" parameter="url %_" />

      <get expression="$url" />
      <command name="insertString" parameter="%_" />
    </sequence>
  </macro>
</command>

<!-- =================================================================== -->
<!-- Works in a DocBook 4 document. -->

<binding>
  <keyPressed code="F7" />
  <command name="startImageViewer" />
</binding>

<command name="startImageViewer">
  <macro>
    <sequence>
      <get context="$implicitElement/@fileref" 
           expression="uri-to-file-name(resolve-uri(.))" />
      <command name="start" parameter='gimp "%_"' />
    </sequence>
  </macro>
</command>

<!-- =================================================================== -->
<!-- Works in a DocBook 4 document. -->

<binding>
  <keyPressed code="F8" />
  <command name="moveListItemDown" />
</binding>

<command name="moveListItemDown">
  <macro undoable="true" label="Move List Item Down">
    <sequence>
      <command name="selectNode" 
        parameter="ancestorOrSelf[implicitElement] listitem callout step" />
      <match context="$selected" pattern="*[position() &lt; last()]" />
      <set variable="anchor" context="$selected" 
           expression="./following-sibling::*[1]" />
      <command name="cut" />
      <set variable="selected" expression="$anchor" />
      <command name="paste" parameter="after" />
    </sequence>
  </macro>
</command>

<binding>
  <keyPressed code="F8" modifiers="shift" />
  <command name="moveListItemUp" />
</binding>

<command name="moveListItemUp">
  <macro undoable="true" label="Move List Item Up">
    <sequence>
      <command name="selectNode" 
        parameter="ancestorOrSelf[implicitElement] listitem callout step" />
      <match context="$selected" pattern="*[position() &gt; 1]" />
      <set variable="anchor" context="$selected" 
           expression="./preceding-sibling::*[1]" />
      <command name="cut" />
      <set variable="selected" expression="$anchor" />
      <command name="paste" parameter="before" />
    </sequence>
  </macro>
</command>

<!-- =================================================================== -->
<!-- Works in a any document. -->

<binding>
  <keyPressed code="F9" />
  <command name="transposeChars" />
</binding>

<command name="transposeChars">
  <macro undoable="true" label="Transpose Characters">
    <sequence>
      <test expression="not($selected) and not($mark) and 
                        $dotOffset &gt; 0 and 
                        $dotOffset &lt; string-length($dot)"/>
      <command name="selectTo" parameter="previousChar" />
      <command name="cut" />
      <command name="moveDotTo" parameter="nextChar" />
      <command name="paste" parameter="into" />
    </sequence>
  </macro>
</command>

</configuration>
