- 3 minutes to read

StylesheetScriptsEnabled - System Parameter

StylesheetScriptsEnabled controls whether embedded scripts, such as msxsl:script blocks in XSLT, may run in Nodinite Stylesheets. The Web Client, the Logging Service, and the Monitoring Service check it whenever they apply a Stylesheet.

At a Glance

Property Value
Key StylesheetScriptsEnabled
Data type boolean
Default false (scripts don't run)
Read by Web Client, Logging Service, Monitoring Service
Takes effect Within about 15 seconds; no restart needed
Status ✅ Active
Since Nodinite 7

How It Works

Stylesheets format message bodies for Log Views and for alerts sent through Alarm Plugins. Standard XSLT and Liquid templates always work. Embedded scripts give you more, for example custom date formatting, calculations, or decoding, but they run custom code inside the Nodinite process.

Value Behaviour
false (default) ❌ A Stylesheet that contains embedded scripts fails, and an error is logged. Stylesheets without scripts work as usual.
true ✅ Embedded scripts in Stylesheets run.

The Line break an EDIFACT and Base64Decode XML from JSON examples contain JavaScript and need this parameter set to true.

Warning

Enabling scripts lets custom code run in Nodinite. Enable it only when you trust everyone who can create or change Stylesheets (members of the built-in Administrator Role), and when standard XSLT or Liquid can't do the job.

Example: XSLT with an Embedded Script

This Stylesheet runs only when StylesheetScriptsEnabled is true:

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:custom="urn:custom-functions">
  <msxsl:script language="C#" implements-prefix="custom">
  <![CDATA[
    public string FormatDateTime(string dateTime, string format)
    {
      DateTime dt = DateTime.Parse(dateTime);
      return dt.ToString(format);
    }
  ]]>
  </msxsl:script>
  <xsl:template match="/">
    <result>
      <formatted-date>
        <xsl:value-of select="custom:FormatDateTime(/data/timestamp, 'yyyy-MM-dd HH:mm:ss')"/>
      </formatted-date>
    </result>
  </xsl:template>
</xsl:stylesheet>

Choosing a Value

  • For security, keep the default false unless a Stylesheet really needs embedded scripts.
  • Before you set it back to false, review your Stylesheets for embedded scripts. Those Stylesheets stop working: Log Views show no formatted body, and alerts lose their formatting.
  • Review who is a member of the Administrator Role, and review new Stylesheets before you use them.

Next Steps