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

## 85. XXE.edit

Parameter syntax:

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

Without a parameter, this command tries to find a reference to an external document (created using an external general entity or a `xi:include` element) starting its search from the node selection or from the element containing the caret. If such reference is found, this command acts on the referenced document.

For example, if a book contains references to external chapter documents, moving the caret anywhere inside a chapter and executing this command without a parameter allows the user to edit this chapter.

Parameters:

`file_name` or `URL`

  Opens or activates specified document.

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>

Prev | Up | Next
84. XXE.close | Home | 86. XXE.new