Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Automation Scripting User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

import

date_range 13-Jan-21

Syntax

content_copy zoom_out_map
import href;

Description

Import rules from an external file or style sheet, which provide access to all the declarations and templates within the imported item. Any import statements must be the first elements in the script or style sheet. The path can be any URI. The path ../import/junos.xsl is standard for all commit scripts, op scripts, and event scripts.

Imported rules are overwritten by any subsequent matching rules within the importing script. If more than one file or style sheet is imported, the items imported last override each previous import where the rules match.

Attributes

href

Specifies the location of the imported file or style sheet.

SLAX Example

In the example, the main script imports the file route-rules.slax, which contains a template rule for <route> elements.

content_copy zoom_out_map
version 1.1;
import "route-rules.slax";

match route {
    <routes> {
        apply-imports;
    }
}

Release Information

Statement introduced in version 1.0 of the SLAX language.

footer-navigation