28. drop

Parameter syntax:

string

This command is intended to be bound to a mouse input. It is generally used by the macro-command which is bound to the drop appEvent in XMLmind XML Editor - Configuration and Deployment.

If the string parameter is an URL or an absolute filename, this command opens the corresponding document using command XXE.open.

Otherwise, the string parameter is assumed to be plain text or the string representation of one or more XML nodes. In this case, the drop command displays a popup menu allowing to copy or move the data being dropped.

Note that only the current text or node selection can be moved within a document. Any data other than the current text or node selection can be copied, but not moved. Moreover, the current text or node selection cannot be moved between two different documents.

DITA topic example:

<binding>
  <appEvent name="drop" />
  <command name="dita.drop" parameter="%{value}" />
</binding>

<command name="dita.drop">
  <macro>
    <choice>
      <sequence>
        <match context="$clickedElement" 
               pattern="xref[@href]|xref[@href]//*|
                        link[@href]|link[@href]//*|
                        longdescref[@href]|
                        longquoteref[@href]" />
        <set variable="selectedElement" context="$clickedElement" 
             expression="(ancestor-or-self::*[@href])[last()]" />

        <set variable="dropped" context="$selectedElement"
             expression="relativize-uri(uri-or-file-name('%*'))" />
        <get expression="$dropped" />
        <command name="putAttribute" parameter="href '%_'" />

        <get expression="$dropped" />
        <command name="status" parameter="href='%_'" />
      </sequence>

      <!-- Default drop action. -->
      <command name="drop" parameter="%*" />
    </choice>
  </macro>
</command>