SLAX is a C-like alternative syntax to XSLT and can be viewed as a preprocessor for XSLT. Before the JUNOS software invokes the XSLT processor, the software converts SLAX constructs (such as if/then/else) to equivalent XSLT constructs (such as <xsl:choose> and <xsl:if>). For more information about SLAX, see Understanding SLAX.
To convert an XSLT script to SLAX, issue the request system scripts convert xslt-to-slax source /var/db/scripts/op/filename destination /var/db/scripts/ operational mode command:
- user@host> request system scripts convert
xslt-to-slax source source/filename destination destination
The source script is the basis for a new script. The source script is not overwritten by the new script.
For example:
- user@host> request system scripts convert
xslt-to-slax source /var/db/scripts/op/script1.xsl destination /var/db/scripts/op
When you issue this command, the script1.xsl file remains in the /var/db/scripts/op and a new script called script1.slax is added to the /var/db/scripts/op directory.
To convert a script from SLAX to XSLT, see Manually Converting a Script from SLAX to XSLT.