role
This topic describes the role element
Description
Roles are used for mapping toolbar buttons and behavior in the editor. For example, when the author presses Enter, SDL Xopus will try to insert the paragraph-role element. In the case of a conflict between what is specified in the configuration roles and a schema declaration, the schema rule will be applied.
Configuration directive
Roles can be assigned to a schema declaration with the roleMapping directive or the node directive, for example:
<x:roleMapping>
<x:element name="p" role="paragraph"/>
</x:roleMapping>
Or with the nodeConfig directive:
<x:nodeConfig>
<x:node match="p">
<x:role>paragraph</x:role>
<x:role>hidden-from-ui</x:role>
...
</x:node>
...
</x:nodeConfig>
Roles apply to schema declarations
A role applies to a schema declaration and not a specific node (according to the node configuration directive). That means you can't use roles in multiple node directives in what will ultimately be the same schema declaration. For example, the following code example will not work as you might be expected. In this example, the notes are hidden in the user interface, not just the notes in a list item:
<x:node match="li/p/note">
<x:role>hidden-from-ui</x:role><!-- DOES NOT WORK AS EXPECTED -->
</x:node>
<x:node match="note">
<x:name xml:lang="en">Note</x:name>
</x:node>
Descriptions of roles
The entire list of roles with description is provided in the related topic:
- Index of Roles
For ease of look-up, the lists are also subdivided into three categories:
- Standard HTML mapping roles
- Semantic roles- groups of roles such as CALs table roles
- Editor-specific roles- these are special, non-standard roles that are useful in this editor.
Namespace
http://www.xopus.com/xmlns/config
Attributes
| Name | Description and use | Type |
|---|---|---|
| Optional. This can only be set to | Fixed value: |
Parent element
node