109. XXE.edit
Prev | Chapter 6. Commands written in the Java™ programming language | Next

## 109. XXE.edit

Parameter syntax:

    [ '[confirm]' ]? [ '[readOnly]' ]? file_name | URL

Opens a document in XXE, unless it is already opened, in which case this command just brings all its views to front and makes this document the ``active'' document.

Parameters:

`[confirm]`

  When the document is not already opened in XXE, this option may be used to display a dialog box asking the user to confirm that she/he really wants to open this document in XXE. This dialog box also allows the user to specify whether the document is to be opened in read-only mode[7].

`[readOnly]`

  This parameter is a modifier which allows to open in read-only mode the document specified by the other parameters.

`file_name` or `URL`

  Opens or activates specified document.

  An URL may have a fragment. Example: `file:/home/john/docs/report122211/report.xml#conclusion`. If the element specified by fragment exists, XXE will automatically scroll to show this element and then it will select it.

Returns newly opened or newly activated `com.xmlmind.xmledit.doc.Document` (for use by higher-level commands) or `Command.EXECUTION_FAILED` if specified document is not already opened in the editor and fails to be opened.

DocBook example: edit other DocBook document referenced in the `url` attribute of implicitly or explicitly selected `ulink` element.

    <command name="docb.editDocument">
      <macro>
        <sequence>
          <get context="$implicitElement/@url" expression="resolve-uri(.)" />
          <command name="XXE.edit" parameter="%_" />
        </sequence>
      </macro>
    </command>

[7] The initial state of the read-only check box found in this dialog box is of course taken from parameter `[readOnly]`.

Prev | Up | Next
108. XXE.compare | Home | 110. XXE.editInclusion