[Contents] [Prev] [Next] [Index] [Report an Error]

<jcs:statement> Template

This template generates a <statement> element suitable for inclusion in an <xnm:error> or <xnm:warning> element. The parameter dot can be passed into the <jcs:statement> template if the error is not at the current position in the XML hierarchy. The following example demonstrates how to call this 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 Imposing a Minimum MTU Setting.


[Contents] [Prev] [Next] [Index] [Report an Error]