Summary of Standard XPath and XSLT Functions Referenced in This Guide
JUNOS Software commit scripts, op scripts, and event scripts support all functions defined in the Extensible Markup Language Path Language (XPath) and Extensible Stylesheet Language Transformations (XSLT) scripting languages. This section describes only the functions referenced in this guide. The functions are organized alphabetically.
concat()
Syntax
string concat(string, string+)
Description
Return the concatenation of the arguments.
See Example: Limiting the Number of E1 Interfaces, Example: Controlling IS-IS and MPLS Interfaces, Example: Adding T1 Interfaces to a RIP Group, Example: Configuring Administrative Groups for LSPs, and Example: Configuring Dual Routing Engines.
contains()
Syntax
boolean contains(string, string)
Description
Return TRUE if the first argument string contains the second argument string, and otherwise returns FALSE.
See Example: Automatically Configuring Logical Interfaces and IP Addresses.
Related Topics
count()
Syntax
number count(node-set)
Description
Return the number of nodes in the argument node-set.
See Example: Limiting the Number of E1 Interfaces.
Related Topics
last()
Syntax
number last()
Description
Return the index of the last node in the list that is currently being evaluated.
See Example: Limiting the Number of E1 Interfaces.
Related Topics
name()
Syntax
string name(<node-set>)
Description
Return the full name of the last node in the node set, including the prefix for its namespace declared in the source document. If no argument is passed, then returns the full name of the context node.
See <jcs:emit-change> Template.
not()
Syntax
boolean not(boolean)
Description
Return TRUE if its argument is FALSE, and FALSE if the argument is TRUE.
See Example: Requiring and Restricting Configuration Statements, Example: Controlling IS-IS and MPLS Interfaces, Example: Configuring a Default Encapsulation Type, Example: Controlling LDP Configuration, Example: Adding a Final then accept Term to a Firewall, Example: Configuring Administrative Groups for LSPs, Example: Configuring Dual Routing Engines, and Example: Preventing Import of the Full Routing Table.
position()
Syntax
number position()
Description
Return the position of the context node among the list of nodes that are currently being evaluated.
See Example: Adding a Final then accept Term to a Firewall and Example: Prepending a Global Policy.
Related Topics
starts-with()
Syntax
boolean starts-with(string, string)
Description
Return TRUE if the first argument string starts with the second argument string, and returns FALSE otherwise.
See Example: Imposing a Minimum MTU Setting, Example: Limiting the Number of E1 Interfaces, Example: Limiting the Number of ATM Virtual Circuits, Example: Adding T1 Interfaces to a RIP Group, Example: Configuring a Default Encapsulation Type, and Example: Configuring Dual Routing Engines.
Related Topics
string-length()
Syntax
number string-length(<string>)
Description
Return the number of characters in the string. If the argument is omitted, it returns the string value of the context node.
See Example: Automatically Configuring Logical Interfaces and IP Addresses.
substring-after()
Syntax
string substring-after(string, string)
Description
Return the substring of the first argument string that occurs after the second argument string. If the second string is not contained in the first string, or if the second string is empty, then it returns an empty string.
See Example: Limiting the Number of E1 Interfaces and Example: Automatically Configuring Logical Interfaces and IP Addresses.
Related Topics
substring-before()
Syntax
string substring-before(string, string)
Description
Return the substring of the first argument string that occurs before the second argument string. If the second string is not contained in the first string, or if the second string is empty, then it returns an empty string.
See Example: Automatically Configuring Logical Interfaces and IP Addresses.