Generating IDs for Elements in Author Mode

Oxygen XML Editor allows you to manually assign or edit values of id attributes in Author mode by using the Attributes View or an in-place attribute editor. Oxygen XML Editor also includes mechanisms to generate ID values for elements, either on-request or automatically, in DITA, DocBook, or TEI documents.

Generate IDs On-Request

You can generate ID values for specific elements on-request. To do so, select the element for which you want to generate an ID (or place the cursor inside the element) and select the Generate IDs action from the contextual menu or the framework-specific menu (DITA, DocBook, or TEI). This action generates a unique ID for the current element. If you invoke the action on a block of selected content, the action will generate IDs for all top-level elements and elements that are listed in the ID Options dialog box that are found in the current selection.
Note: The Generate IDs action does not overwrite existing ID values. It only affects elements that do not already have an id attribute.

Automatically Generate IDs

Oxygen XML Editor includes an option to automatically add unique ID values to certain elements when they are created in Author mode. The Auto generate IDs for elements option can be found in the ID Options dialog box that is displayed when you select the ID Options action from the framework-specific menu (DITA, DocBook, or TEI). If enabled, Oxygen XML Editor automatically generates unique ID values for elements that are listed in this dialog box. You can use this dialog box to customize the format of the ID values and choose which elements will have their ID values automatically generated (for example, you can customize the list of elements to include those that you most often need to identify).

ID Options Dialog Box

Figure: ID Options Dialog Box

The ID Options dialog box allows you to configure the following options in regards to generating ID values:
ID Pattern
The pattern for the ID values that will be generated. This text field can be customized using constant strings or any of the Oxygen XML Editor Editor Variables.
Element name or class value to generate ID for
The elements for which ID values will be generated, specified using class attribute values. To customize the list, use the Add, Edit, or Remove buttons.
Auto generate IDs for elements
If enabled, Oxygen XML Editor will automatically generate unique IDs for the elements listed in this dialog box when they are created in Author mode.
Remove IDs when copying content in the same document
When copying and pasting content in the same document, this option allows you to control whether or not pasted elements that are listed in this dialog box should retain their existing IDs. To retain the element IDs, disable this option.
Note: This option does not have an effect on content that is cut and pasted.

Duplicating Elements with Existing IDs

If you duplicate elements with existing IDs (for example, through copy/paste or drag/drop actions), all IDs are removed at the resolution of the operation. However, you can use the options in the ID Options dialog box to change this behavior. The options in this dialog box affect duplicated elements with existing IDs in the following ways:
Note: Only the elements listed in this dialog box are affected by these options. Therefore, if you want to use these options to preserve IDs or generate new ones, you must first add the elements to be duplicated to the list in this dialog box.