join() Function (SLAX)
Namespaces
http://xml.libslax.org/slax
SLAX Syntax
var $string = slax:join(separator, string1, string2 ...);
Description
Combine a set of strings and add a separator between each item.
Parameters
separator |
Character to use as the delimiter between strings. |
string |
One or more strings to combine. |
Return Value
string |
String that concatenates all of the specified strings using the separator as the delimiter between each item. |
Usage Examples
The following script uses the join() function to construct a file path and
an IP address.
version 1.3;
ns junos = "http://xml.juniper.net/junos/*/junos";
ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";
ns slax = "http://xml.libslax.org/slax";
import "../import/junos.xsl";
match / {
var $path = slax:join("/", "/var", "db", "scripts", "op");
copy-of($path);
var $ip = slax:join(":", "10", "10", "10", "1");
copy-of($ip);
}
The resulting strings are:
/var/db/scripts/op 10:10:10:1
Release Information
Function introduced in SLAX version 1.3.