Supported Platforms
Related Documentation
- ACX, EX, M, MX, SRX, T Series
- Junos Named Templates in the jcs Namespace Summary
- ACX, EX, M, MX, PTX, SRX, T Series
- Junos Script Automation: Named Templates in the jcs Namespace Overview
- call
- xnm:error (Junos XML)
- xnm:warning (Junos XML)
- xsl:call-template
jcs:statement Template
XSLT Syntax
<xsl:call-template name="jcs:statement">
<xsl:with-param name="dot" select="expression"/>
</xsl:call-template>
SLAX Syntax
call jcs:statement($dot=expression);
Description
Generate a <statement> element suitable for inclusion in an <xnm:error> or <xnm:warning> element. This location defaults to “ . ”, the current position in the XML hierarchy. If the error is not at the current position in the XML hierarchy, you can alter the default when you call the template by including a valid XPath expression either for the dot parameter in SLAX scripts or for the select attribute of the dot parameter in XSLT scripts.
Parameters
dot | — | XPath expression specifying the hierarchy level. The default location is the position in the XML hierarchy that the script is currently evaluating. You can alter the default when you call the template by including a valid XPath expression either for the dot parameter in SLAX scripts or for the select attribute of the dot parameter in XSLT scripts. |
Usage Examples
The following example demonstrates how to call the jcs:statement template in a commit script:
<xnm:error>
<xsl:call-template name="jcs:edit-path"/>
<xsl:call-template name="jcs:statement">
<xsl:with-param name="dot" select="mtu"/>
</xsl:call-template>
<message>
<xsl:text>SONET interfaces must have a minimum MTU of </xsl:text>
<xsl:value-of select="$min-mtu"/>
<xsl:text>.</xsl:text>
</message>
</xnm:error>
When you commit a configuration that includes a SONET/SDH interface with a maximum transmission unit (MTU) setting less than a specified minimum, the <xnm:error> element results in the following CLI output:
[edit]
user@host# commit
[edit interfaces interface so-1/2/3] 'mtu 576;' # mtu statement generated by the jcs:statement template SONET interfaces must have a minimum MTU of 2048.
error: 1 error reported by commit scripts
error: commit script failure
The test of the MTU setting is not performed in the <xnm:error> element. For the full example, see Example: Imposing a Minimum MTU Setting.
Related Documentation
- ACX, EX, M, MX, SRX, T Series
- Junos Named Templates in the jcs Namespace Summary
- ACX, EX, M, MX, PTX, SRX, T Series
- Junos Script Automation: Named Templates in the jcs Namespace Overview
- call
- xnm:error (Junos XML)
- xnm:warning (Junos XML)
- xsl:call-template
Published: 2013-03-05
Supported Platforms
Related Documentation
- ACX, EX, M, MX, SRX, T Series
- Junos Named Templates in the jcs Namespace Summary
- ACX, EX, M, MX, PTX, SRX, T Series
- Junos Script Automation: Named Templates in the jcs Namespace Overview
- call
- xnm:error (Junos XML)
- xnm:warning (Junos XML)
- xsl:call-template