115. XXE.edit

Parameter syntax:

[ '[master=' [ master_document_URL ]? ']' ]?
[ '[confirm]' ]? [ '[readOnly]'|'[readWrite]' ]? 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:

[master=master_document_URL]

Advanced, rarely needed, option. No effect if the document is already opened in XXE. Informs XXE that the document is possibly a module which is being opened from master document master_document_URL. URL master_document_URL defaults to the URL of the document from which the XXE.edit command has been invoked.

[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]

Allows to open in read-only mode the document specified by the other parameters.

[readWrite]

Allows to open in normal read-write 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].