Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

attribute

 

Syntax

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-nameName of the attribute, which can be an XPath expression or a string. Enclose string arguments in quotes.
attribute-valueA 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":

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.