Edit online

Inserting an Olink in DocBook Documents

  1. Decide which documents are to be included in the domain for cross referencing.
    A unique ID must be assigned to each document that will be referenced with an <olink>. It is usually added as an @id (or @xml:id for DocBook5) attribute to the root element of the document.
  2. Decide on your output hierarchy.
    For creating links between documents, the relative locations of the output documents must be known. Before going further you must decide the names and locations of the output directories for all the documents from the domain. Each directory will be represented by an element: <dir name="directory_name">, in the target database document.
  3. Create the target database document.
    Each collection of documents has a main target database document that is used to resolve all olinks from that collection. The target database document is an XML file that is created once. It provides a means for pulling in the target data for each document. The database document is static and all the document data is pulled in dynamically.
  4. Generate the target data files by executing a DocBook transformation scenario.
    Before applying the transformation, you need to edit the transformation scenario, go to the Parameters tab, and make sure the value of the collect.xref.targets parameter is set to yes. The default name of a target data file is target.db, but it can be changed by setting an absolute file path in the targets.filename parameter.
  5. Insert <olink> elements in the DocBook documents.
    When editing a DocBook XML document in Author mode, the Insert OLink action is available in the Link drop-down menu from the toolbar. This action opens the Insert OLink dialog box that allows you to select the target of an <olink> from the list of all possible targets from a specified target database document (specified in the Targetset URL field). Once a Targetset URL is selected, the structure of the target documents is presented. For each target document (@targetdoc), its content is displayed, allowing you to easily identify the appropriate @targetptr. You can also use the search fields to quickly identify a target. If you already know the values for the @targetdoc and @targetptr attributes, you can insert them directly in the corresponding fields.
  6. Process a DocBook transformation for each document to generate the output.