Querys in templates without empty line? [message #1699252] |
Tue, 23 June 2015 00:34  |
Eclipse User |
|
|
|
Hello together,
I am using Java services and hence querys to do some additional calculations or checks.
In some cases, the java services (and so the querys) shall return *nothing* or *null*. For example if no matching objects where found.
I call this querys with a simple
[queryName/]
In this case, I will get newlines in the target file after each query even if the return value of the service is null.
Is there a possiblity to avoid this newlines in case of "no" return of the query?
Kind Regards and thank you in advice,
Martin
|
|
|
Re: Querys in templates without empty line? [message #1699255 is a reply to message #1699252] |
Tue, 23 June 2015 01:39  |
Eclipse User |
|
|
|
Hi
Generally the new line from
[queryName/] <NL>
comes from the <NL> following the empty query. If you don't want it,
don't put a <NL> there, i.e you must have long unreadable lines.
Or embed the query within an if that gives you some control, although I
never could fathom quite which <NL>s in an if are ignored. So you are in
the realm of empirical programming.
Getting your output to be immaculately pretty printed can require quite
a lot of experiment.
Alternatively follow Acceleo's advice and follow the transformation with
a pretty printer.
Regards
Ed Willink
On 23/06/2015 05:34, Martin Gruber wrote:
> Hello together,
> I am using Java services and hence querys to do some additional
> calculations or checks.
>
> In some cases, the java services (and so the querys) shall return
> *nothing* or *null*. For example if no matching objects where found.
>
> I call this querys with a simple
> [queryName/]
>
> In this case, I will get newlines in the target file after each query
> even if the return value of the service is null.
>
> Is there a possiblity to avoid this newlines in case of "no" return of
> the query?
>
> Kind Regards and thank you in advice,
> Martin
|
|
|
Powered by
FUDForum. Page generated in 0.35347 seconds