Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community Forums[Acceleo] line feeds in templates
https://www.eclipse.org/forums/index.php/mv/msg/159454/503690/#msg_503690
I am nearly a Acceleo/MTL beginner,
i have a basic but important question about line feed management in templates,
assuming i have the following template :
It works fine, but now i have the requirements :
- I do not want line feeds in output between parts (part1 part2 ...)
- I do not want to write sub-templates for maintenance reasons (too many templates in the same .mtl)
So the basic solution is to write again on a single line :
--> Editing the template becomes difficult (line too long with real cases)
Is there a dedicated way to "escape" the line feeds in the template ?
Thanks.]]>Fabien Giquel2009-12-15T06:07:55-00:00Re: [Acceleo] line feeds in templates
https://www.eclipse.org/forums/index.php/mv/msg/159454/503731/#msg_503731
ok, i will go on without it.
thanks for the answer.]]>Fabien Giquel2009-12-15T09:42:41-00:00Re: [Acceleo] line feeds in templates
https://www.eclipse.org/forums/index.php/mv/msg/159454/503713/#msg_503713
--------------050100010303020908000803
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Hi Fabien,
There is no way to remove line feeds as you need for such a behavior.
The only way to have the results of distinct ifs on the same line is to
remove all line feeds in between as you've shown with your "basic solution".
There is no other way ATM, and I do not think there will be. If with a
template like you have there is no line feeds in-between the resulting
"part*", then how do we do if the need is to _have_ line feeds?
Laurent Goubet
Obeo
Fabien Giquel wrote:
> Hi,
> I am nearly a Acceleo/MTL beginner,
> i have a basic but important question about line feed management in
> templates,
> assuming i have the following template :
>
> [template myTemplate(...)]
> [if (cond1)]part1[/if]
> [if (cond2)]part2[/if]
> [for (cond3)]part3[/for]
> [if (cond4)]part4[/if]
> ..
> [if (condN)]partN[/if]
> [/template]
>
> It works fine, but now i have the requirements :
> - I do not want line feeds in output between parts (part1 part2 ...)
> - I do not want to write sub-templates for maintenance reasons (too many
> templates in the same .mtl)
>
> So the basic solution is to write again on a single line :
>
> [template myTemplate(...)][if (cond1)]part1[/if][if
> (cond2)]part2[/if][for (cond3)]part3[/for][if (cond4)]part4[/if]...[if
> (condN)]partN[/if]
> [/template]
>
> --> Editing the template becomes difficult (line too long with real cases)
>
> Is there a dedicated way to "escape" the line feeds in the template ?
>
> Thanks.