Formatting

Removing extra lines

All characters inside scripts are used for generation output, including spaces, line breaks, or carriage return characters.

Template content

Actual output

Expected output

<gendoc>¶
..[for (p:Package | self.ownedElement->filter( Package )->sortedBy(name))].¶

[p.name/].¶

..[/for].¶
</gendoc>.¶
...¶

Allocations.¶

...¶

Context.¶

...¶

LogicalView.¶

...¶

PhisicalView.¶

...¶

UseCases.¶

...¶
Allocations.¶

Context.¶

LogicalView.¶

PhisicalView.¶

UseCases.¶

<drop/> tag allows to remove extra lines. If after applying <drop/> tag, the textbox containing it is empty, the empty text box is removed also.

<dropSlide/> tag allows to remove the whole slide.

Document generation is internally performed in two steps and <drop/> tag removes the WHOLE paragraph in which it is contained and <dropSlide/> tag removes the whole slide 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

<gendoc>
..[for (p:Package | self.ownedElement->filter( Package )->sortedBy(name))]

[p.name/].¶

..[/for]
</gendoc>
..

Allocations.¶

..

Context.¶

..

LogicalView.¶

..

PhisicalView.¶

..

UseCases.¶

..

Template content

before <drop/> and <dropSlide/>  handling

Final output

<gendoc>¶
..[for (p:Package | self.ownedElement->filter( Package )->sortedBy(name))].<dropSlide/>¶

[p.name/].¶

..[/for].¶
</gendoc>.<dropSlide>¶
...<dropSlide/>¶

Allocations.¶

.<dropSlide/>..¶

Context.¶

.<dropSlide/>..¶

LogicalView.¶

.<dropSlide/>..¶

PhisicalView.¶

.<dropSlide/>..¶

UseCases.¶

...¶
.<dropSlide/>¶
Allocations.¶

Context.¶

LogicalView.¶

PhisicalView.¶

UseCases.¶

Removing lines with empty content

Tag <dropEmpty/> drop a paragraph if the tag content is empty.