All characters inside scripts are used for generation output, including spaces, line breaks, or carriage return characters.
Template content |
Actual output |
Expected output |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
<drop/> tag allows to remove extra rows.
Document generation is internally performed in two steps and <drop/> tag removes the WHOLE row in which it is contained so it must be handled with care.
First step is to analyze the lines to get as output to understand where the extra lines come from in the template and where the <drop/> tags should be located.
Template content |
Output |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Template content |
before <drop/> handling |
Final output |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Tag <dropEmpty/> drop a paragraph if the tag content is empty.
The two following examples are equivalent:
A | B | |
---|---|---|
1 | <context model=’${model_path}’/> <gendoc><drop/> |
|
2 | All comments on packages: | |
3 |
[for (p:Package|Package.allInstances()->sortedBy(name))] [for (c:Comment| p.ownedComment)]<drop/> |
|
4 | - Comment for package [p.name/]: <dropEmpty>[c._body/]</dropEmpty> | |
5 |
[/for] [/for] </gendoc><drop/> |
A | B | |
---|---|---|
1 | <context model=’${model_path}’/> <gendoc><drop/> |
|
2 | All comments on packages: | |
3 |
[for (p:Package|Package.allInstances()->sortedBy(name))] [for (c:Comment| p.ownedComment)] [if (not(c._body.oclIsUndefined()))] <drop/> |
|
4 |
- Comment for package [p.name/]: [c._body/] |
|
5 |
[/if] [/for] [/for] </gendoc><drop/> |