Log in to ask questions, share your expertise, or stay connected to content you value. Don’t have a login? Learn how to become a member.
To track the failure or success of a SLAX script, you typically look through several blocks of XML. If a certain value exists in one of more of the blocks, run a "success" block of code; otherwise, run a "failure" block of code. This would be trivial if the SLAX script had variables that you...
You could craft a template that makes a best-effort conversion from a Junos XML configuration to a Junos OS CLI configuration as shown in the following example: From: <protocols> <bgp> <group> <name>23</name> <import>policy1<...
While the XSLT 1.1 standard was never finalized, libxslt adopted some parts of it anyway, including the <xsl:document> instruction element, which later came to be known as <xsl:result-document> in XSLT 2.0. This element is used to output XML, HTML, or text to an output file. ...
The exsit "set" extension is perfect for finding identifying differences in two samples of XML. See the page titled Using set:difference() in SLAX to Quickly Figure Out What's Different for information on its usage in SLAX. #Slax #How-To #xml
If you want spaced columns then you will want to use the jcs: printf() function. This returns a correctly spaced string which can then be displayed on the console through the jcs: output() function. The following page has an example from eol-scanner.slax that uses jcs: printf(): ...
Writing rtt Details into an Accounting Profile File For SLAX version 1.0 and higher, the op script runs every 5 minutes, pinging the remote host and writing the rtt details into an accounting profile file . This op script is similar to op-ping-rtt.slax but without using jcs...
Identify Configuration Identifiers Identifiers are used as unique keys to differentiate between two otherwise identical configuration stanzas. For example, consider the <interfaces> hierarchy, which can, and almost always does, contain multiple instances of <interface> child...
Display Output of Terminated Script Without an Error Statement For SLAX version 1.0 and higher, you can display output of a terminated script without an error statement. The <xsl:message> instruction element writes a message to the user terminal, and including the terminate=...