Supported Platforms
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- SLAX Elements and Element Attributes Overview
- ACX, EX, J, M, MX, SRX, T Series
- attribute-set
- element
- use-attribute-sets
attribute
Syntax
attribute attribute-name { attribute-value; }
Release Information
Statement introduced in version 1.1 of the SLAX language, which is supported in Junos OS Release 12.2 and later releases.
Description
Create an attribute with the given name. The attribute value is defined by a block of statements, which must be placed inside a set of braces.
Attributes
attribute-name | — | Name of the attribute, which can be an XPath expression or a string. Enclose string arguments in quotes. |
attribute-value | — | A block of statements enclosed in curly braces that defines the attribute value. |
SLAX Example
In the following example, the <book> element is output to the result tree with an attribute named format, which has the value "PDF":
<book> { attribute "format" { expr "PDF"; } }
In the following example, the value of the <name> node (rather than the literal string "name") is used to create an XML attribute with a value of "from‑" concatenated with the contents of the address node. Node values are selected from the current context.
<source> { attribute name { expr "from-" _ address; } }
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- SLAX Elements and Element Attributes Overview
- ACX, EX, J, M, MX, SRX, T Series
- attribute-set
- element
- use-attribute-sets
Published: 2013-07-26
Supported Platforms
Related Documentation
- ACX, EX, M, MX, PTX, SRX, T Series
- SLAX Elements and Element Attributes Overview
- ACX, EX, J, M, MX, SRX, T Series
- attribute-set
- element
- use-attribute-sets