97. XXE.save

Parameter syntax:

[ '[ifNeeded]' ]?

Saves document currently opened in XXE.

[ifNeeded]

With this option, this command does nothing at all but can be successfully executed if current document does not need to be saved.

Without this option, this command cannot be executed if current document does not need to be saved.

This option is useful in macro commands such as the one in the example below.

Returns Command.EXECUTION_FAILED if document cannot be saved or if user has canceled the command. Otherwise, returns null.

Example:

  <command name="editXMLSource">
    <macro>
      <sequence>
        <command name="XXE.save" parameter="[ifNeeded]" />
        <command name="run" parameter='emacs "%D"' />
        <command name="XXE.open" parameter="[reopenIfNewer]" />
      </sequence>
    </macro>
  </command>
  1. Save the document being edited, if this is needed.

  2. Load it in external text editor GNU Emacs. Use this text editor to modify it or simply to view it.

  3. Reload the document in XXE, but only if it has been modified using Emacs.