88. XXE.openAsTemplate
Prev | Chapter 6. Commands written in the Java™ programming language | Next

## 88. XXE.openAsTemplate

Parameter syntax:

    [ (template_file_or_URL | '-') [ save_file_or_URL | '-' ]? ]?

Creates a new document using an existing document as a template. After loading a copy of the existing document, all the content of the copy is discarded to just keep a valid skeleton of the root element.

Parameters:

`template_file_or_URL`

  Specifies which document to use as a template.

  When this argument is absent or is specified as "`-`", the command displays the file chooser dialog box to let the user specify an existing document.

`save_file_or_URL`

  When this argument is specified as a filename or URL, the newly created document is immediately saved to specified location.

  When this argument is specified as "`-`", the command displays the file chooser dialog box to let the user specify a save location for the newly created document. After this, the newly created document is immediately saved to specified location.

  When this argument is absent, the newly created document is automatically given a save location but it is not actually saved to this location (that is, the command behaves like menu item File|Open As Template).

Returns newly created `com.xmlmind.xmledit.doc.Document` (for use by higher-level commands) or `Command.EXECUTION_FAILED` if specified template cannot be opened or if user has canceled the command.

Prev | Up | Next
87. XXE.open | Home | 89. XXE.openCopy