Edit online

Some built-in frameworks include a configuration file that defines shortcut patterns that can be used in Author mode to automatically insert a certain XML structure. More specifically, the XML structure (fragment) automatically replaces a specific prefix pattern. For example, if you are editing a DITA document using the built-in DITA framework, entering a hyphen (-) followed by a space at the beginning of a paragraph would automatically replace them with an unordered list element (<ul>) with a child list item element (<li>). This is made possible by the AutoCorrect mechanism in Oxygen XML Author Eclipse plugin.

It is possible to customize the particular configuration file (structureAutocorrect.xml) to define your own markup insertion shortcut patterns by following these steps:
  1. Create a new resources folder (if it does not already exist) in the frameworks directory for the particular document type (for example, OXYGEN_INSTALL_DIR/frameworks/dita/resources).
  2. Open the Preferences dialog box and go to Document Type Association. Select the particular document type, click the Edit button, and in the Classpath tab add a link to that resources folder (if it does not already exist).
  3. Create a new structureAutocorrect.xml file or edit an existing one (this file already exists in the resources folder of particular document types and you can use an existing file as a starting point for your customization).
  4. Make the appropriate changes to your structureAutocorrect.xml file. The file should look like this:
      <!-- Unordered lists -->
      <prefix-replacement prefix="-">
      <!-- Ordered lists -->
      <prefix-replacement prefix="1.">
      <!-- Code block -->  
      <prefix-replacement prefix="```">

    Using this example, when a user enters one of the defined prefixes at the start of an element that allows the corresponding fragment, Oxygen XML Author Eclipse plugin will automatically replace the prefix with its corresponding fragment. For example, entering a hyphen (-) at the beginning of a paragraph followed by a space would automatically replace them with an unordered list element (<ul>) with a child list item element (<li>). Any subsequently added content would be placed inside the first node/element that does not have a child node/element (in this example, the cursor would be placed in the first <li> element).

  5. Save the file in the resources folder for the particular document type, using the fixed name: structureAutocorrect.xml (for example, OXYGEN_INSTALL_DIR/frameworks/dita/resources/structureAutocorrect.xml).
  6. Restart the application and open a document for your particular framework to test your customization.
    Note: Once the file is created, changes that you make to it are processed by Oxygen XML Author Eclipse plugin when you press the Reload toolbar button.