element
Syntax
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.
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.