jcs:edit-path Template

Syntax

<xsl:call-template name="jcs:edit-path">
    <xsl:with-param name="dot" select="expression"/>
</xsl:call-template>

Description

Generate an <edit-path> element suitable for inclusion in an <xnm:error> or <xnm:warning> element. By default, the location of the configuration error is passed as dot into the <jcs:edit-path> template. This location defaults to “ .” , the current position in the XML hierarchy. You can alter the default by including the select attribute of the dot parameter.

Parameters

<xsl:param name="dot" select=".">—Allows you to indicate a location other than the current location in the XML hierarchy. The select attribute contains the current context “ .” as a default value. If you want to change the current context, you can include the dot parameter and include a different XPath expression in the select attribute.

Usage Guidelines

The following example demonstrates how to call this template in a commit script and set the context to the [edit chassis] hierarchy level:

The <jcs:edit> template generates an <edit-path> element suitable for inclusion in an <xnm:error> or <xnm:warning> element. The location of the configuration error is passed as dot into the <jcs:edit-path> template. This location defaults to “ .” , the current position in the XML hierarchy. You can alter the default by including the select attribute of the dot parameter. The following example demonstrates how to call this template in a commit script and set the context to the [edit chassis] hierarchy level:

<xsl:if test="not(chassis/source-route)">
    <xnm:warning>
        <xsl:call-template name="jcs:edit-path">
            <xsl:with-param name="dot" select="chassis"/>
        </xsl:call-template>
        <message>IP source-route processing is not enabled.</message>
    </xnm:warning>
</xsl:if>

When you commit a configuration that does not enable IP source routing, the <xnm:warning> element results in the following command-line interface (CLI) output:


user@host# commit
[edit chassis] # The hierarchy level is generated by the <jcs:edit-path> template.
    warning: IP source-route processing is not enabled.
commit complete

Related Topics