VTL: Formatting Issues - Precisely_EnterWorks - EnterWorks - 11.0

EnterWorks Guide

Product type
Software
Portfolio
Verify
Product family
EnterWorks
Product
Precisely EnterWorks
Precisely EnterWorks > EnterWorks
Version
11.0
Language
English
Product name
Precisely EnterWorks
Title
EnterWorks Guide
Copyright
2024
First publish date
2007
Last updated
2025-01-07
Published on
2025-01-07T07:44:20.997000

Although VTL in this user guide is often displayed with newlines and whitespaces, the VTL shown below:

#set( $imperial = ["Munetaka","Koreyasu","Hisakira","Morikune"] )
#foreach( $shogun in $imperial )
	$shogun
#end

is equally valid as the following snippet that Geir Magnusson, Jr. posted to the Velocity user mailing list to illustrate a completely unrelated point:

Send me #set($foo=["$10 and ","a pie"])#foreach($a in $foo)$a#end please.

Velocity's behavior is to gobble up excess whitespace. The preceding directive can be written as:

Send me #set( $foo = ["$10 and ","a pie"] )
#foreach( $a in $foo ) $a #end please.

or as:

Send me
#set($foo = ["$10 and ","a pie"])
#foreach ($a in $foo )
	$a
#end please.

In each case the output will be the same.