Pathfinder Applications
Note: † Internal applications are hidden from customers and partners. This is visible to you because you have logged into HPEs internal network.
Navigation
Table of Contents
Guide That Contains This Content
[+] Expand All
[-] Collapse All
Related Documentation
- ACX Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- EX Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- M Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- MX Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- PTX Series
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- SRX Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- T Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
template
Syntax
template qualified-name (parameter-name = value) {
/* code */
}Release Information
Statement introduced in version 1.0 of the SLAX language.
Description
Declare a named template. You can include a comma-separated list of parameter declarations, with the parameter name and an optional equal sign (=) and value expression. You can declare additional parameters inside the code block using the param statement. You can invoke the template using the call statement.
SLAX Example
match configuration {
var $name-servers = name-servers/name;
call temp();
call temp($name-servers, $size = count($name-servers));
call temp() {
with $name-servers;
with $size = count($name-servers);
}
template temp($name-servers, $size = 0) {
<output> "template called with size " _ $size;
}
}XSLT Equivalent
<xsl:template match="configuration">
<xsl:variable name="name-servers" select="name-servers/name"/>
<xsl:call-template name="temp"/>
<xsl:call-template name="temp">
<xsl:with-param name="name-servers" select="$name-servers"/>
<xsl:with-param name="size" select="count($name-servers)"/>
</xsl:call-template>
<xsl:call-template name="temp">
<xsl:with-param name="name-servers" select="$name-servers"/>
<xsl:with-param name="size" select="count($name-servers)"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="temp">
<xsl:param name="name-servers"/>
<xsl:param name="size" select="0"/>
<output>
<xsl:value-of select="concat('template called with size ', $size)"/>
</output>
</xsl:template>
Usage Examples
See Example: Adding a Final then accept Term to a Firewall and Example: Adding T1 Interfaces to a RIP Group.
Related Documentation
- ACX Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- EX Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- M Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- MX Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- PTX Series
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- SRX Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with
- T Series
- SLAX Parameters Overview
- SLAX Templates Overview
- apply-templates
- call
- match
- mode
- priority
- with