Junos Extension Functions in the jcs Namespace

The Junos extension functions are used in commit, op and event scripts to accomplish scripting tasks more easily. Extension functions allow you to perform operations that are difficult or impossible to perform in XPath. Junos extension functions use the jcs prefix to avoid conflicting with standard XSLT functions. To use functions in the jcs namespace in your scripts, you must map to the jcs namespace in your style sheet declaration as shown in the following examples:

XSLT Syntax

<?xml version=”1.0”?>
<xsl:stylesheet version=”1.0”
         xmlns:jcs="http://xml.juniper.net/junos/commit-scripts/1.0">
    ...
</xsl: stylesheet>

SLAX Syntax

version 1.0;
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";

You then include variable declarations, a variable call with the select="jcs:function()" attribute for XSLT scripts or a simple function call for SLAX scripts, and pass along any required or optional arguments.

The Junos extension functions are discussed in detail in the following sections: