31. include
Prev | Chapter 6. Commands written in the Java™ programming language | Next

## 31. include

Parameter syntax:

    'into' | ('replace'|'before'|'after' [ implicit_selection ]?)
    [ '[useEntity]'|'[useXInclude]'|'[chooseBest]' ]? [ S url ]?

into

  Pastes a reference to an element into element containing caret, at caret position.

replace

  Pastes a reference to an element replacing text selection or selected nodes..

before or after

  Pastes a reference to an element before of after selected nodes.

`URL` specifies which document (that is, which root element) to reference. An element deep inside the document may be referenced by adding an XPointer fragment to the URL.

A relative URL is relative to the location of the document being edited.

If `URL` is not specified, a specialized dialog box is displayed allowing the user to specify it, possibly with an XPointer fragment.

The mechanism used to paste a reference is normally specified by the Preferences dialog box in the Edit tab. Options `useEntity`, `useXInclude`, `chooseBest` may be used to override the user preferences specified there:

useEntity

  Always use the reference to an external entity mecanism (for example, to ease the interchange of the documents you create with XXE).

useXInclude

  Always use the XInclude mechanism. See http://www.w3.org/TR/xinclude/.

chooseBest

  Use the reference to an external entity mecanism when possible (example: the referencing document has a `<!DOCTYPE>` and no XPointer is being used) and the XInclude mechanism otherwise (example: the referencing document does not have `<!DOCTYPE>` or a XPointer is needed).

Examples:

    include into
    include after[implicitElement]
    include after[implicitElement][useEntity]
    include replace[useXInclude] ../common/Copyright.html
    include before http://www.numbers.com/england/numbers.html#vat

Commands copyAsInclusion (generally bound to keystroke Shift-Ctrl-C) and pasteInclusionEnabled (generally bound to keystroke Ctrl-V) are used to compose modular documents, see the corresponding tutorial section in the User's Guide.

Command include can be used to implement an alternative user interface for composing modular documents and may be also useful in macro-commands.

See also copyAsInclusion, copyInclusionEnabled, cutInclusionEnabled, pasteInclusionEnabled.

Command copyAsInclusion, like command `include` requires the presence of the `XInclude` processor. This processor, available by default, may be disabled by using the `inclusionProcessor` configuration element. See Section 13, “inclusionProcessor” in XMLmind XML Editor - Configuration and Deployment.

This command works only in XMLmind XML Editor Professional Edition.

Prev | Up | Next
30. extractobject | Home | 32. insert