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

element

date_range 13-Jan-21

Syntax

content_copy zoom_out_map
element name {
  /* element contents */
}

Description

Create an element node with the given name. The element name can be an XPath expression or a string. The element contents must be placed inside curly braces.

Attributes

name

Name of the element, which can be an XPath expression or a string. Enclose string arguments in quotes.

SLAX Example

The following sample code uses the value of the name node (rather than the literal string "name") to create an XML element, whose contents are an empty element with a name of "from‑" concatenated with the value of the address node. Node values are selected from the current context.

content_copy zoom_out_map
for-each (list/item) {
    element name {
        element "from-" _ address;
    }
}

Release Information

Statement introduced in version 1.1 of the SLAX language, which is supported in Junos OS Release 12.2 and later releases.

footer-navigation