Add or manage Stylesheet
Transform logged messages into user-friendly formats for self-service Log Views and alarm notifications.
A Stylesheet is associated with one or more Message Types to render user-friendly output for logged messages (Log Events) and alert notifications sent by Alarm Plugins.
Understanding the Stylesheet Editor
Name and Description"] --> B["fa:fa-code Type
XSLT or Liquid"] B --> C["fa:fa-tags Associate
Message Types"] C --> D["fa:fa-file-lines Message Body
Raw input, File upload, or Message Id"] D --> E["fa:fa-eye Preview"] E --> F["fa:fa-save Save"] style A fill:#2678BD,color:#fff style B fill:#2678BD,color:#fff style C fill:#2678BD,color:#fff style D fill:#E47528,color:#fff style E fill:#E47528,color:#fff style F fill:#93d16d,color:#000
Define the Stylesheet (blue), test it against sample data (orange), and save it (green) so Log Views and Alarm Plugins can use it.
Key Capabilities
- Transform XML messages with XSLT into HTML or other XML formats
- Transform JSON messages with Liquid templates
- Preview output before deploying to production
- Associate one stylesheet with multiple Message Types
- Customize display for both Log Views and email alerts
| Option | Best for | Input |
|---|---|---|
| XSLT | XML messages and the alarm object of the Email Alarm Plugins | XML |
| Liquid | JSON messages, flat files, and the Event Log Alarm Plugin | JSON, or the raw body as text |
Add Stylesheet
Click the 'Add stylesheet' button to create a new Stylesheet for use with selected Message Types.

The Add Stylesheet button sits in the upper right corner of the Stylesheets Overview.
The Add Stylesheet form opens with these fields and options, top to bottom:

A new Stylesheet defaults to XSLT; only the Name is mandatory, and the Save buttons are greyed out on the empty form.
| Field or option | Where | Description |
|---|---|---|
| Name * | Main form | Mandatory name of the Stylesheet, shown in the Stylesheets list and when you pick a Stylesheet elsewhere. |
| Description | Main form | Optional details about the Stylesheet's purpose. |
| Type | Main form | The template language: XSLT (default) or Liquid, see below. |
| Render as HTML | Main form | Checkbox. When checked, the output is rendered as HTML. |
| Message Body is Json | Main form | Shown when Type is Liquid. When checked, the message body is treated as JSON; when unchecked, it is available as {{data}}, see Liquid. |
| Stylesheet | Main form | The code editor for the template (left pane) next to the rendered preview (right pane); drag the divider between them to resize. Above the editor sit the Message Body button, which opens the test message dialog (see Preview with a test message body), an icon for full-screen editing, and an icon that rotates the two panes between side by side and stacked. This split editor is shared across Nodinite: Articles, and the BPM and C4 Diagram views opened from a Log View, work the same way. |
| Message Types | Right panel | Click Edit to bind specific Message Types, see Associate with Message Types. |
| Message Types By Name | Right panel | Click Edit to bind Message Types by a name pattern, see Bind by name. |
| Save, Save and close, Close | Bottom right | Save keeps the editor open, Save and close returns to the list, and Close leaves the editor. The header also holds Add Stylesheet and Save. |
Next, select the type of stylesheet. Currently, the following two formats are supported:

The editor below the Type field switches to the selected language.
XSLT
XSLT stands for EXtensible Stylesheet Language Transformations, and is a style sheet language for XML documents.
Use XSLT to format XML messages into other XML formats or HTML. Set the output MIME type with xsl:output, see Output Content-Type.
Liquid
If the message body is JSON you can use Liquid instead of XSLT to produce your output. With Message Body is Json checked, Nodinite injects the JSON properties as Liquid variables; unchecked, the raw body is available as {{data}} (see Line break an EDIFACT for an example).
Warning
A Stylesheet with embedded scripts, such as
msxsl:scriptblocks or JavaScript, runs only when the StylesheetScriptsEnabled System Parameter istrue. With the defaultfalse, the Stylesheet fails and an error is logged.
Associate with Message Types
Click one of the Edit buttons to open a new dialogue to enter one or more Message Types. The include option by name (Message Types By Name, with % wildcards) is new with Nodinite version 7 New 7.x.

Two ways to bind: Message Types one by one, or Message Types By Name, here with the filter O2C.Order.Received/1.0 (#1). Click the red minus to remove a binding.
Tip
Multiple Message Types can be associated with the same Stylesheet.
Bind specific Message Types
Click Edit on the Message Types panel to open Assign Message Types to Stylesheet.

Filter the list of Message Types, check the ones the Stylesheet should format, and click Confirm and close. The Selected tab shows what is bound.
Bind Message Types by name
Click Edit on the Message Types By Name panel to open Assign Message Types by name to Stylesheet. A name filter also binds Message Types created later, as long as their names match.

Each filter uses the SQL LIKE operator, so % is a wildcard: %test matches every Message Type whose name ends with "test". Preview shows the first 10 Message Types that match the most recently changed or clicked filter.
- Type a name or pattern in the filter box.
- Click Add Filter to add more patterns; a Message Type that matches any filter is bound.
- Check the matches in Preview, then click Confirm and close.
Preview with a test message body
Test the Stylesheet against a sample message before you save it. The editor shows the template on the left and the rendered output on the right; until you supply a message body, the right pane says Please enter a message body to load the preview.

An existing Liquid Stylesheet bound by name to O2C.Order.Received/1.0. The preview pane stays empty until you load a message body.
Open the Stylesheet (or start a new one) and click Message Body above the editor.

The button sits to the right of the Stylesheet label, next to the full-screen icon.The Edit Stylesheet dialog opens with the template on the left. Under Step 1 - Select data input, choose where the test message comes from: Raw input (default), File upload, or Message Id.

With Raw input, paste the sample message into the Step 2 - Raw input box ("The message to preview").Under Step 2, supply the message body for the option you chose:
- Raw input – paste or type the message data.
- File upload – click Browse, or drop one file on the drop zone, to load a file that contains the message data.
- Message Id – pick a Log Database in Select Log Database, enter the Message Id of a logged message (Log Event), and click Get Message. The message appears in Message data. The locate in Admin view link helps you find the Message Id.

Upload a sample file when the message is too large to paste.
Fetch a real logged message to test the Stylesheet against production data.Leave Auto-close after input checked to close the input menu and open the preview as soon as the message body is in place. Uncheck it to stay on the input steps.
Click Preview in the dialog header to switch between the message body input and the rendered output. Click it again to go back and change the message.

The Preview button toggles the right side of the dialog between the message body and the rendered preview.Click Confirm to keep the message body and stay in the dialog, Confirm and close to keep it and return to the Stylesheet editor, or Close to leave the dialog.

An order in XML format output as HTML using an XSLT Stylesheet.
Tip
If the preview fails for a Stylesheet with embedded scripts, check the StylesheetScriptsEnabled System Parameter. For ready-made templates to test with, see the Stylesheet Examples.