Code Templates

Code templates are small document fragments that can be reused in other editing sessions. <oXygen/> comes with a large set of ready-to use templates for XSL, XQuery and XML Schema. You can even share your code templates with your colleagues using the Export and Import functions. To obtain the template list you can use the Content Completion on request shortcut key (usually CTRL-SPACE) or the Code Templates on request shortcut key (CTRL-SHIFT-SPACE). The first shortcut displays the code templates in the same content completion list with elements from the schema of the document. The second shortcut displays only the code templates and is the default shortcut of the action DocumentContent CompletionShow Code Templates .

The Code Templates preferences panel is opened from menu OptionsPreferences+Editor+Templates+Code Templates

 

Figure 20.28. The Code Templates preferences panel

The Code Templates preferences panel

New

Define a new code template.

You can define a code template for a specific type of editor or for all editor types.

Edit

Edit the selected code template.

Duplicate

Duplicate the selected code template.

Delete

Delete the selected code template.

Import

Import a file with code templates.

Export

Export a file with code templates.