Message Format - ExtensionML
ExtensionML is a special form of markup that a front end app can use to perform custom rendering of an entity, instead of relying on Symphony to perform the default presentation.
ExtensionML is generated from a given entity and emitted by a built-in or third-party renderer. It is similar to PresentationML but is used for interactive presentation.
While similar to PresentationML, ExtensionML consists of a template and corresponding data. Each tag in the template can have an ID that references a value stored in the data, binding the data to whatever is being rendered. For example, multiple paragraphs in the template can reference a sentence stored in the data by ID, allowing for reuse of that sentence in multiple places within the template being rendered.
Symphony Elements
Note: ExtensionML does not support Symphony Elements. For more information, refer to Symphony Elements.
Standard HTML Tags
A number of standard HTML tags are supported within templates: b
, u
, i
, strong
, br
, ul
, ol
, li
, span
, div
, table
, th
, tr
, and td
.
These behave like their HTML counterparts but must be properly-formatted XML. So, for example, rather than <br>
you must use <br/>
.
Text Tags
The following tags present text in different ways. Most of these require data to specify their content, but some can also use the content between the opening and closing tags.
Tag | Description | Attributes |
| Adds text formatted with HTML markup. This must be properly formatted XML See here for information on converting HTML to XHTML. | • |
| Specifies regular text to be inserted into the entity. This text is inserted as is, without processing any HTML markup. | • |
| Inserts a label. Labels are like text tags but are styled differently. | • |
| Inserts a colored text. Supported colors: red, purple, green, darkGreen, blue, darkBlue, orange, grey, and yellow. |
|
| Inserts text with a colored background and rounded corners. Supported colors: red, purple, green, darkGreen, blue, darkBlue, orange, grey, and yellow. |
|
Extended HTML Tags
The following HTML tags are handled in a slightly modified way:
Tag | Description | Attributes |
| Inserts a link. | • |
| Inserts a horizontal line. | |
| Displays a 16x16 pixel icon. | • |
| Displays a 13x13 pixel icon. | • |
| Displays a 128x128 pixel image. | • |
| Inserts an iframe. | • |
Special Entity Tags
Tag | Description | Attributes |
| Insert a mention. | • |
| Inserts a hashtag. | • |
| Inserts a cashtag. | • |
Flow Control Tags
The following flow control tags are used for entities that have conditional logic or data that can be iterated upon:
Tag | Description | Attributes |
| Conditionally uses the enclosing template. | • |
| Conditionally uses the enclosing template within an iteration. If the current iteration is not the last item in the iterated list, the enclosing template is used. This is convenient when you want to add commas between list items without adding one after the last item. | |
| Conditionally uses the enclosing template within an iteration. If the current iteration is the last item in the iterated list, the enclosing template will be used. | |
| Loops through the items in an array. The template between the opening and closing | • |
The following example shows the XML template for an entity with flow control logic and corresponding data:
Generating Properly Formatted XML
The following function can be used to turn HTML into properly formatted XML:
Last updated