Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
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

break-lines() Function (SLAX and XSLT)

date_range 13-Jan-21

Namespaces

content_copy zoom_out_map
http://xml.juniper.net/junos/commit-scripts/1.0
http://xml.libslax.org/slax

SLAX Syntax

content_copy zoom_out_map
var $lines = prefix:break-lines(expression);

XSLT Syntax

content_copy zoom_out_map
<xsl:variable name="lines" select="prefix:break-lines(expression)"/>

Description

Break a simple element into multiple elements, delimited by newlines. This is especially useful for large output elements such as those returned by the show pfe command.

The prefix associated with the namespace URI should be defined in the prefix-to-namespace mapping in the style sheet.

Parameters

expression

Original output.

Return Value

$lines

Output broken up into lines.

Usage Examples

content_copy zoom_out_map
var $lines = jcs:break-lines($output);
for-each ($lines) {
    ...
}

Release Information

Function introduced in Junos OS Release 7.6

Support for the slax namespace http://xml.libslax.org/slax added in Junos OS Release 12.2.

footer-navigation