[#while condition]
body
[/#while]
where:
The while tag processes the code between the start-tag and end-tag while the condition evaluates to true.
This code prints the name of an element and of its owners:
Hierarchy:
[#set]element : uml21.Element = ...[/#set]
[#while element != null]
name: ${element.name}
[#set]element = element.owner[/#set]
[/#while]
The above code would produce an output similar to the following:
Hierarchy:
Account
AccountPackage
Model