role

Roles are used for mapping toolbar buttons and behavior in the editor. For example, when the author presses Enter, Xopus will try to insert the paragraph-role element. Roles are used as hints, however, as Xopus will always follow the rules specified in the schema.

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

Note that a role applies to a schema declaration and not a specific node that has a match according to the node configuration directive. That means you can't use roles in multiple node directives on what ends up being the same schema declaration. For example, this example does not work as you would expect. It means that all 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>

Index of roles

address

The HTML equivalent is <address>. This role is used to map clipboard data in HTML format to the document's schema.

align

The HTML equivalent is the align attribute of an any HTML element. This role is used to map clipboard data in HTML format to the document's schema.

audio

This element receives an icon in the UI. The HTML equivalent is <audio>.

auto-insert

Like the paragraph role, this role can be used to configure an item as the default choice for an element that ought to contain at least one of a choice.

blockquote

This element receives an icon in the UI, and has may-split and auto-insert behaviors. The HTML equivalent is <blockquote>.

button

The HTML equivalent is <button>. This role is used to map clipboard data in HTML format to the document's schema.

cellcolspan

The table editor uses this attribute to specify the the number of columns a cell spans. The HTML equivalent is colspan. See also tablecell.

cellendcolumnname

Specifies the name of the rightmost column of a CALS table cell span.

cellstartcolumnname

Specifies the name of the leftmost column of a CALS table cell span.

cellmorerows

Specifies the number of additional rows in a CALS table cell.

cellrowspan

The table editor uses this attribute to specify the the number of rows a cell spans. The HTML equivalent is rowspan. See also tablecell.

checkbox

The HTML equivalent is <input type="checkbox">. This role is used to map clipboard data in HTML format to the document's schema.

checked

The HTML equivalent is the checked attribute on the <input> element. This role is used to map clipboard data in HTML format to the document's schema.

citation

The HTML equivalent is <cite>. This role is used to map clipboard data in HTML format to the document's schema.

color

If this attribute is defined as an enumeration in the schema it receives an icon in the UI of Xopus. The property editor will use a color picker with hexadecimal color values on attributes or simple type elements with the color role.

content

This attribute will be included in spell checking and search actions. By default attributes are treated as non-content. See also non-content.

definitionlist

The HTML equivalent is a <dl>.

definitionlistdefinition

The HTML equivalent is a <dd>. This role is used to map clipboard data in HTML format to the document's schema.

definitionlistdefinitionterm

The HTML equivalent is a <dt>. This role is used to map clipboard data in HTML format to the document's schema.

directorylist

The HTML equivalent is a <dir>. This role is used to map clipboard data in HTML format to the document's schema.

divider

The HTML equivalent is a <hr>. This role is used to map clipboard data in HTML format to the document's schema.

emphasis

The toolbar will add an I button to insert and remove this element. The HTML equivalent is <em>.

fileinput

The HTML equivalent is <input type="file">. This role is used to map clipboard data in HTML format to the document's schema.

flash

The toolbar will add an Insert Flash button to insert and remove this element.

form

The HTML equivalent is <form>. This role is used to map clipboard data in HTML format to the document's schema.

header

The HTML equivalent is a <h>, <h1>, <h2> etc.

height

The HTML equivalent is the height attribute. This role is used to map clipboard data in HTML format to the document's schema.

hidden-from-ui

This role, which can be configured for both elements and attributes, hides the configured elements and attributes from the user in the interface. The nodes will no longer show up in lists of options for adding elements.

hiddeninput

The HTML equivalent is <input type="hidden">. This role is used to map clipboard data in HTML format to the document's schema.

hyperlink

The toolbar will add an insert hyperlink button to insert and remove this element. The HTML equivalent is <a>.

hyperlinkreference

The HTML equivalent is the href attribute on the <a> element. This role is used to map clipboard data in HTML format to the document's schema.

image

The toolbar will add an insert image button to insert and remove this element. The HTML equivalent is <img>.

imagebutton

The HTML equivalent is <input type="image">. This role is used to map clipboard data in HTML format to the document's schema.

imagesource

The HTML equivalent is the src attribute of an <img>.

inline-object

This role is for inline objects, for example footnotes, that need different behavior from inline formatting.

label

The HTML equivalent is <label>. This role is used to map clipboard data in HTML format to the document's schema.

labelfor

The HTML equivalent is the for attribute on the <label> element. This role is used to map clipboard data in HTML format to the document's schema.

linebreak

This element will be inserted when the user presses Shift+Enter. The HTML equivalent is <br>.

list

Currently not used; See definitionlist, ordered-list and unorderedlist.

listitem

The HTML equivalent is <li>.

may-split

This is indicates that the element may be split when the user presses Enter.

may-not-split

This indicates that the element may not be split when the user presses Enter, causing Xopus to try to split its parent.

mediaalign

The HTML equivalent is the align attribute of an <img>.

non-content

This element will not be included in spellchecking and search actions. By default, elements are treated as content. See also content.

orderedlist

The toolbar will add an ordered list button to insert and remove this element. The HTML equivalent is <ol>.

paragraph

This element will often be inserted when the user presses Enter. The HTML equivalent is <p>.

passwordinput

The HTML equivalent is <input type="password">. This role is used to map clipboard data in HTML format to the document's schema.

preformatted

The HTML equivalent is <pre>. (Note: Use a xml:space="preserve" attribute on an element to obtain the similar space and newline behavior as in HTML.)

quote

This element receives an icon in the UI, and has may-split and auto-insert behaviors. The HTML equivalent is <blockquote>.

radiobutton

The HTML equivalent is <input type="radio">. This role is used to map clipboard data in HTML format to the document's schema.

resetbutton

The HTML equivalent is <input type="reset">. This role is used to map clipboard data in HTML format to the document's schema.

section

This element receives an icon in the UI, and has may-split and auto-insert behaviors. The HTML equivalents are <div> and <section>.

selectbox

The HTML equivalent is <select>. This role is used to map clipboard data in HTML format to the document's schema.

selectboxoption

The HTML equivalent is <option>. This role is used to map clipboard data in HTML format to the document's schema.

selectboxselectedindex

The HTML equivalent is the selectedindex attribute on the <select> element. This role is used to map clipboard data in HTML format to the document's schema.

significant

Assign this role to an attribute, when Xopus shouldn't consider elements empty if they have this attribute. In several situations Xopus will automatically remove elements if they are considered empty. F.e. an align attribute is not significant, but an href attribute is.

strikethrough

The HTML equivalent is <s>. This role is used to map clipboard data in HTML format to the document's schema.

strong

The toolbar will add a B button to insert and remove this element. The HTML equivalent is <strong>.

subheader

A subheader role element follows a header role element.

submitbutton

The HTML equivalent is <input type="submit">. This role is used to map clipboard data in HTML format to the document's schema.

subscript

The toolbar will add a subscript button to insert and remove this element. The HTML equivalent is <sub>.

superscript

The toolbar will add a superscript button to insert and remove this element. The HTML equivalent is <sup>.

symbol

The role allows people to use backspace and delete to remove inline element that do not contain text content themselves, such as as inline images. The role linebreak automatically receives this role.

table

This element will be inserted by the table editor. The HTML equivalent is <table>.

tablebody

This element can be inserted by the table editor. The HTML equivalent is a row group <tbody>.

tableborder

The HTML equivalent is the border attribute on a <table>. This role is used to map clipboard data in HTML format to the document's schema.

tablecaption

The HTML equivalent is <caption>. This role is used to map clipboard data in HTML format to the document's schema.

tablecellcontainer

The table editor will insert table cells in this element. The HTML equivalent is <tr>.

tablecell

The table editor can insert this element in the tablecellcontainer. The HTML equivalent is <td>. See also cellrowspan and cellcolspan.

tablecellpadding

The HTML equivalent is the cellpadding attribute on a <table>. This role is used to map clipboard data in HTML format to the document's schema.

tablecellspacing

The HTML equivalent is the cellspacing attribute on a <table>. This role is used to map clipboard data in HTML format to the document's schema.

tablecolumncontainer

The table editor will mark the element as tablecolumncontainer. The CALS equivalent is a table section <tgroup>.

tablecolumncount

The number of columns in a CALS table group (tablecolumncontainer).

tablecolumnspec

Specifies a CALS column element.

tablecolumnnumber

Specifies the attribute that contains the number of a CALS column.

tablecolumnname

Specifies the attribute that contains the name of a CALS column.

tablefooter

This element can be inserted by the table editor. The HTML equivalent is a row group <tfoot>.

tableheader

This element can be inserted by the table editor. The HTML equivalent is a row group <thead>.

tableheadercell

The table editor can insert this element in the tablecellcontainer. The HTML equivalent is <th>.

tableheaderrow

The table editor can insert this element in the tablerowcontainer. The DITA equivalent is a simpletable header <sthead>.

tablerow

The table editor will insert this element in the tablerowcontainer. The HTML equivalent is <tr>.

tablerowcontainer

The table editor will insert table rows in this element.

textlineinput

The HTML equivalent is <input type="text>. This role is used to map clipboard data in HTML format to the document's schema.

textareainput

The HTML equivalent is <textarea>. This role is used to map clipboard data in HTML format to the document's schema.

underline

The toolbar will add a U button to insert and remove this element. The HTML equivalent is <u>.

unorderedlist

The toolbar will add an ordered list button to insert and remove this element. The HTML equivalent is <ul>.

valign

The HTML equivalent is the valign attribute. This role is used to map clipboard data in HTML format to the document's schema.

video

This element receives an icon in the UI. The HTML equivalent is <video>.

width

The HTML equivalent is the width attribute. This role is used to map clipboard data in HTML format to the document's schema.


role element

Namespace: http://www.xopus.com/xmlns/config

Attributes

use
This can only be set to prohibited which will unset the role. This can be useful where element inherit roles from other element, such as in DITA. (Optional)

History

version event
Xopus 4.2.3 Change. Added inline-object role.
Xopus 4.1.3 Change. Added significant role.
Xopus 4.1 Change. Added tableheaderrow role for DITA support (Case 196679)
Xopus 3.2.3 Introduction.
Xopus 3.2.13 Change. Added hidden-from-ui role.
Xopus 3.2.12 Change. Added may-split and auto-insert roles.
Xopus 3 Change. Some roles are exclusive, like ol/ul and sub/sup. (Case 33188)