XMLmind XML Editor allows to include in document B some content found in document A. This feature works by using a special command called Copy As Reference and then by using one of the normal Paste commands. Unlike the ordinary Copy/Paste commands which duplicate content, Copy As Reference copies a reference to some content found in document A. This means document B will always be up to date no matter how you'll modify document A.
(Internally, XMLmind XML Editor uses standard mechanisms, e.g. conref for DITA and XInclude for DocBook, to implement this feature, so you don't have to worry about the portability of the modular documents you'll create.)
This
feature is generally used to create modular documents. For example, a
modular DocBook book
(Book.xml
) includes several
chapters, each chapter
element being authored in its own file
(Chapter1.xml
, Chapter2.xml
, etc). This way, different
authors may work on different chapters at the same time and also, it's
more comfortable to work on a relatively short chapter rather than on a
large, monolithic, book.
This feature is also used to include “boilerplate” content in a document: company name, product name, copyright statement, etc. More about this in next lesson: Inserting boilerplate content.
Edit
Reference Copy As Reference (keyboard shortcut: Ctrl+Shift-C) works like ordinary Edit Copy (keyboard shortcut: Ctrl-C), except that the node selection must comprise a single element and this element must have an ID (or if it does not have an ID, it must be the root element of the document). After you invoke Copy As Reference, notice that the Clipboard tool displays the name of the referenced element using a dimmed blue/gray color.Note that it's not possible to Copy As Reference some included content. If you want to do that, simply use the normal Copy command. The normal Copy and Cut commands both preserve references when they are used to copy content to the clipboard.
After using Edit
Paste Before (keyboard shortcut: Ctrl-U), Edit Paste (keyboard shortcut: Ctrl-V) or Edit Paste After (keyboard shortcut: Ctrl-W) to paste the reference copied using Copy As Reference, the included content is rendered using a blue/gray color. This special color means that the included content is read-only. That is, it cannot be edited in place.In order to edit some included content, you'll have to open the document which actually contains the data. Fortunately, this is done very easily by using menu item Edit
Reference Edit Referenced Document (keyboard shortcut: Ctrl+Shift-E).From there, switching back to the included content is done by using menu item Edit
Reference Edit Referencing Document (keyboard shortcut: Ctrl+Shift-B).