Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Re: Remove whitespaces from generation
Re: Remove whitespaces from generation [message #8081] Wed, 28 March 2007 21:05 Go to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

John,

Please use the M2T newsgroup for JET2 questions. I've added it to the
"to" list so Paul should see your question. He might need more detail
though. Often the goodness of the answer is proportional to the amount
of information provided in the question...


John Slave wrote:
> Hi,
>
> i am using emft jet generation to create java code however i cannot
> find how to remove whitespaces (these whitespaces are that from used
> tags).
>
> Thanks in advance
> Tobia Loschiavo
Re: Remove whitespaces from generation [message #8267 is a reply to message #8081] Thu, 29 March 2007 12:31 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
John:

JET2 removes write space when a tag (or other language element) is alone on
a line.

Rule of thumb: If you don't want write space associated with a tag, put it
on its own line.

So:

<c:iterate select... >
Some code
</c:iterate>

Should produce

Some code
Some code
Some code
...

But, if you put a comment on the line

<c:iterate select... > <%-- a comment --%>
Some code
</c:iterate>

You'd get:

Some code

Some code

Some code

"Ed Merks" <merks@ca.ibm.com> wrote in message
news:euelal$d3e$1@build.eclipse.org...
> John,
>
> Please use the M2T newsgroup for JET2 questions. I've added it to the
> "to" list so Paul should see your question. He might need more detail
> though. Often the goodness of the answer is proportional to the amount of
> information provided in the question...
>
>
> John Slave wrote:
>> Hi,
>>
>> i am using emft jet generation to create java code however i cannot find
>> how to remove whitespaces (these whitespaces are that from used tags).
>>
>> Thanks in advance
>> Tobia Loschiavo
Re: Remove whitespaces from generation [message #8361 is a reply to message #8267] Thu, 29 March 2007 13:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matroska.libero.it

Paul Elder ha scritto:
> John:
>
> JET2 removes write space when a tag (or other language element) is alone on
> a line.
>
> Rule of thumb: If you don't want write space associated with a tag, put it
> on its own line.
>
> So:
>
> <c:iterate select... >
> Some code
> </c:iterate>
>
> Should produce
>
> Some code
> Some code
> Some code
> ...
>
> But, if you put a comment on the line
>
> <c:iterate select... > <%-- a comment --%>
> Some code
> </c:iterate>
>
> You'd get:
>
> Some code
>
> Some code
>
> Some code
>

Hi thank you for the answer. I have this code:

private void _init() throws Exception {
<%int index=1;%>
<c:iterate select="//container/*" var="current">
<c:choose>
<c:when test="$current[name()='radio']">
code to write
....

The result is:
private void _init() throws Exception {




code to write

Why!? All has been done with jeteditor.
Thank you
John Slave




> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:euelal$d3e$1@build.eclipse.org...
>> John,
>>
>> Please use the M2T newsgroup for JET2 questions. I've added it to the
>> "to" list so Paul should see your question. He might need more detail
>> though. Often the goodness of the answer is proportional to the amount of
>> information provided in the question...
>>
>>
>> John Slave wrote:
>>> Hi,
>>>
>>> i am using emft jet generation to create java code however i cannot find
>>> how to remove whitespaces (these whitespaces are that from used tags).
>>>
>>> Thanks in advance
>>> Tobia Loschiavo
>
>
Re: Remove whitespaces from generation [message #8423 is a reply to message #8361] Thu, 29 March 2007 14:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matroska.libero.it

Resolved you are right! Sorry and thank you!

John Slave

John Slave ha scritto:
> Paul Elder ha scritto:
>> John:
>>
>> JET2 removes write space when a tag (or other language element) is
>> alone on a line.
>>
>> Rule of thumb: If you don't want write space associated with a tag,
>> put it on its own line.
>>
>> So:
>>
>> <c:iterate select... >
>> Some code
>> </c:iterate>
>>
>> Should produce
>>
>> Some code
>> Some code
>> Some code
>> ...
>>
>> But, if you put a comment on the line
>>
>> <c:iterate select... > <%-- a comment --%>
>> Some code
>> </c:iterate>
>>
>> You'd get:
>>
>> Some code
>>
>> Some code
>>
>> Some code
>>
>
> Hi thank you for the answer. I have this code:
>
> private void _init() throws Exception {
> <%int index=1;%>
> <c:iterate select="//container/*" var="current">
> <c:choose>
> <c:when test="$current[name()='radio']">
> code to write
> ...
>
> The result is:
> private void _init() throws Exception {
>
>
>
>
> code to write
>
> Why!? All has been done with jeteditor.
> Thank you
> John Slave
>
>
>
>
>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>> news:euelal$d3e$1@build.eclipse.org...
>>> John,
>>>
>>> Please use the M2T newsgroup for JET2 questions. I've added it to
>>> the "to" list so Paul should see your question. He might need more
>>> detail though. Often the goodness of the answer is proportional to
>>> the amount of information provided in the question...
>>>
>>>
>>> John Slave wrote:
>>>> Hi,
>>>>
>>>> i am using emft jet generation to create java code however i cannot
>>>> find how to remove whitespaces (these whitespaces are that from used
>>>> tags).
>>>>
>>>> Thanks in advance
>>>> Tobia Loschiavo
>>
>>
Re: Remove whitespaces from generation [message #8453 is a reply to message #8267] Thu, 29 March 2007 15:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

I get the same thing and yes I have comments all over the place trying to
make the text understandable.

Are you saying to remove these ghost blank lines you have to remove all
comments ? Seems a shame.



"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:eugbj7$qk8$1@build.eclipse.org...
> John:
>
> JET2 removes write space when a tag (or other language element) is alone
> on a line.
>
> Rule of thumb: If you don't want write space associated with a tag, put it
> on its own line.
>
> So:
>
> <c:iterate select... >
> Some code
> </c:iterate>
>
> Should produce
>
> Some code
> Some code
> Some code
> ...
>
> But, if you put a comment on the line
>
> <c:iterate select... > <%-- a comment --%>
> Some code
> </c:iterate>
>
> You'd get:
>
> Some code
>
> Some code
>
> Some code
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:euelal$d3e$1@build.eclipse.org...
>> John,
>>
>> Please use the M2T newsgroup for JET2 questions. I've added it to the
>> "to" list so Paul should see your question. He might need more detail
>> though. Often the goodness of the answer is proportional to the amount
>> of information provided in the question...
>>
>>
>> John Slave wrote:
>>> Hi,
>>>
>>> i am using emft jet generation to create java code however i cannot find
>>> how to remove whitespaces (these whitespaces are that from used tags).
>>>
>>> Thanks in advance
>>> Tobia Loschiavo
>
>
Re: Remove whitespaces from generation [message #8544 is a reply to message #8081] Sat, 31 March 2007 15:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Something else I notice is a blank line appears in generation if you put a
<c:log> </c:log> line in.


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:euelal$d3e$1@build.eclipse.org...

> John,
>
> Please use the M2T newsgroup for JET2 questions. I've added it to the
> "to" list so Paul should see your question. He might need more detail
> though. Often the goodness of the answer is proportional to the amount of
> information provided in the question...
>
>
> John Slave wrote:
>> Hi,
>>
>> i am using emft jet generation to create java code however i cannot find
>> how to remove whitespaces (these whitespaces are that from used tags).
>>
>> Thanks in advance
>> Tobia Loschiavo
Re: Remove whitespaces from generation [message #9818 is a reply to message #8453] Mon, 02 April 2007 12:03 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

No, just put them on a separate line.

I'll have another look at the new line trimming algorthim to see if I can
make it more friendly with respect to comments. No promises for this
release, so it still comes down to, put your comments on a separate line.

<%-- Good: do something --%>
<c:iterate ... >

<c:iterate ...> <%-- Bad: will result in a an unexpected new line --%>

Paul

"Stu" <evaandoli@dodo.com.au> wrote in message
news:eugl88$70b$1@build.eclipse.org...
>I get the same thing and yes I have comments all over the place trying to
>make the text understandable.
>
> Are you saying to remove these ghost blank lines you have to remove all
> comments ? Seems a shame.
>
>
>
> "Paul Elder" <pelder@ca.ibm.com> wrote in message
> news:eugbj7$qk8$1@build.eclipse.org...
>> John:
>>
>> JET2 removes write space when a tag (or other language element) is alone
>> on a line.
>>
>> Rule of thumb: If you don't want write space associated with a tag, put
>> it on its own line.
>>
>> So:
>>
>> <c:iterate select... >
>> Some code
>> </c:iterate>
>>
>> Should produce
>>
>> Some code
>> Some code
>> Some code
>> ...
>>
>> But, if you put a comment on the line
>>
>> <c:iterate select... > <%-- a comment --%>
>> Some code
>> </c:iterate>
>>
>> You'd get:
>>
>> Some code
>>
>> Some code
>>
>> Some code
>>
>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>> news:euelal$d3e$1@build.eclipse.org...
>>> John,
>>>
>>> Please use the M2T newsgroup for JET2 questions. I've added it to the
>>> "to" list so Paul should see your question. He might need more detail
>>> though. Often the goodness of the answer is proportional to the amount
>>> of information provided in the question...
>>>
>>>
>>> John Slave wrote:
>>>> Hi,
>>>>
>>>> i am using emft jet generation to create java code however i cannot
>>>> find how to remove whitespaces (these whitespaces are that from used
>>>> tags).
>>>>
>>>> Thanks in advance
>>>> Tobia Loschiavo
>>
>>
>
>
Re: Remove whitespaces from generation [message #9859 is a reply to message #9818] Mon, 02 April 2007 12:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

I have all comments on a separate line so it must be something else. I'll
look more into it and post something with more detail if I can narrow it
down.

The <c:log>Log here</c:log>

Seems to add a blank line is what I have found so far.

Cheers for all your time.
Stu

"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:euqrei$jfl$1@build.eclipse.org...
> Stu:
>
> No, just put them on a separate line.
>
> I'll have another look at the new line trimming algorthim to see if I can
> make it more friendly with respect to comments. No promises for this
> release, so it still comes down to, put your comments on a separate line.
>
> <%-- Good: do something --%>
> <c:iterate ... >
>
> <c:iterate ...> <%-- Bad: will result in a an unexpected new line --%>
>
> Paul
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:eugl88$70b$1@build.eclipse.org...
>>I get the same thing and yes I have comments all over the place trying to
>>make the text understandable.
>>
>> Are you saying to remove these ghost blank lines you have to remove all
>> comments ? Seems a shame.
>>
>>
>>
>> "Paul Elder" <pelder@ca.ibm.com> wrote in message
>> news:eugbj7$qk8$1@build.eclipse.org...
>>> John:
>>>
>>> JET2 removes write space when a tag (or other language element) is alone
>>> on a line.
>>>
>>> Rule of thumb: If you don't want write space associated with a tag, put
>>> it on its own line.
>>>
>>> So:
>>>
>>> <c:iterate select... >
>>> Some code
>>> </c:iterate>
>>>
>>> Should produce
>>>
>>> Some code
>>> Some code
>>> Some code
>>> ...
>>>
>>> But, if you put a comment on the line
>>>
>>> <c:iterate select... > <%-- a comment --%>
>>> Some code
>>> </c:iterate>
>>>
>>> You'd get:
>>>
>>> Some code
>>>
>>> Some code
>>>
>>> Some code
>>>
>>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>>> news:euelal$d3e$1@build.eclipse.org...
>>>> John,
>>>>
>>>> Please use the M2T newsgroup for JET2 questions. I've added it to the
>>>> "to" list so Paul should see your question. He might need more detail
>>>> though. Often the goodness of the answer is proportional to the amount
>>>> of information provided in the question...
>>>>
>>>>
>>>> John Slave wrote:
>>>>> Hi,
>>>>>
>>>>> i am using emft jet generation to create java code however i cannot
>>>>> find how to remove whitespaces (these whitespaces are that from used
>>>>> tags).
>>>>>
>>>>> Thanks in advance
>>>>> Tobia Loschiavo
>>>
>>>
>>
>>
>
>
Re: Remove whitespaces from generation [message #9931 is a reply to message #9859] Wed, 04 April 2007 12:18 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

<c:log>Log here</c:log>

would add a line, while

<c:log>
Log here
</c:log>

will not.

The whitespace/line stripping would have to get smarter about the intent of
individual tags to successfully do the right thing on:

<c:log>Log here</c:log>

and, and the same time:

<f:lc>Lower Case here</f:lc>

I'll give it some thought. Here's a bugzilla to track it...

https://bugs.eclipse.org/bugs/show_bug.cgi?id=180927

Paul

"Stu" <evaandoli@dodo.com.au> wrote in message
news:euqsgl$rhf$1@build.eclipse.org...
>I have all comments on a separate line so it must be something else. I'll
>look more into it and post something with more detail if I can narrow it
>down.
>
> The <c:log>Log here</c:log>
>
> Seems to add a blank line is what I have found so far.
>
> Cheers for all your time.
> Stu
>
> "Paul Elder" <pelder@ca.ibm.com> wrote in message
> news:euqrei$jfl$1@build.eclipse.org...
>> Stu:
>>
>> No, just put them on a separate line.
>>
>> I'll have another look at the new line trimming algorthim to see if I can
>> make it more friendly with respect to comments. No promises for this
>> release, so it still comes down to, put your comments on a separate line.
>>
>> <%-- Good: do something --%>
>> <c:iterate ... >
>>
>> <c:iterate ...> <%-- Bad: will result in a an unexpected new line --%>
>>
>> Paul
>>
>> "Stu" <evaandoli@dodo.com.au> wrote in message
>> news:eugl88$70b$1@build.eclipse.org...
>>>I get the same thing and yes I have comments all over the place trying to
>>>make the text understandable.
>>>
>>> Are you saying to remove these ghost blank lines you have to remove all
>>> comments ? Seems a shame.
>>>
>>>
>>>
>>> "Paul Elder" <pelder@ca.ibm.com> wrote in message
>>> news:eugbj7$qk8$1@build.eclipse.org...
>>>> John:
>>>>
>>>> JET2 removes write space when a tag (or other language element) is
>>>> alone on a line.
>>>>
>>>> Rule of thumb: If you don't want write space associated with a tag, put
>>>> it on its own line.
>>>>
>>>> So:
>>>>
>>>> <c:iterate select... >
>>>> Some code
>>>> </c:iterate>
>>>>
>>>> Should produce
>>>>
>>>> Some code
>>>> Some code
>>>> Some code
>>>> ...
>>>>
>>>> But, if you put a comment on the line
>>>>
>>>> <c:iterate select... > <%-- a comment --%>
>>>> Some code
>>>> </c:iterate>
>>>>
>>>> You'd get:
>>>>
>>>> Some code
>>>>
>>>> Some code
>>>>
>>>> Some code
>>>>
>>>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>>>> news:euelal$d3e$1@build.eclipse.org...
>>>>> John,
>>>>>
>>>>> Please use the M2T newsgroup for JET2 questions. I've added it to the
>>>>> "to" list so Paul should see your question. He might need more detail
>>>>> though. Often the goodness of the answer is proportional to the
>>>>> amount of information provided in the question...
>>>>>
>>>>>
>>>>> John Slave wrote:
>>>>>> Hi,
>>>>>>
>>>>>> i am using emft jet generation to create java code however i cannot
>>>>>> find how to remove whitespaces (these whitespaces are that from used
>>>>>> tags).
>>>>>>
>>>>>> Thanks in advance
>>>>>> Tobia Loschiavo
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: Remove whitespaces from generation [message #11416 is a reply to message #9931] Thu, 12 April 2007 04:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: evaandoli.dodo.com.au

Ok I got around to finding my problem with a blank line appearing when I
think it shouldnt.

Here is the line that caused trouble:-

PreText1
<c:addTextElement select="$conductorType/valueHolder" name="notFoundName"
var="notFound">NotFound</c:addTextElement>

PostText1

Output looks like:
PreText1

PostText1

I tried:-
<c:addTextElement select="$conductorType/valueHolder" name="notFoundName"
var="notFound">
NotFound
</c:addTextElement>

but got the same result.

Stuart

"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:ev053l$dvg$1@build.eclipse.org...
> Stu:
>
> <c:log>Log here</c:log>
>
> would add a line, while
>
> <c:log>
> Log here
> </c:log>
>
> will not.
>
> The whitespace/line stripping would have to get smarter about the intent
> of individual tags to successfully do the right thing on:
>
> <c:log>Log here</c:log>
>
> and, and the same time:
>
> <f:lc>Lower Case here</f:lc>
>
> I'll give it some thought. Here's a bugzilla to track it...
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=180927
>
> Paul
>
> "Stu" <evaandoli@dodo.com.au> wrote in message
> news:euqsgl$rhf$1@build.eclipse.org...
>>I have all comments on a separate line so it must be something else. I'll
>>look more into it and post something with more detail if I can narrow it
>>down.
>>
>> The <c:log>Log here</c:log>
>>
>> Seems to add a blank line is what I have found so far.
>>
>> Cheers for all your time.
>> Stu
>>
>> "Paul Elder" <pelder@ca.ibm.com> wrote in message
>> news:euqrei$jfl$1@build.eclipse.org...
>>> Stu:
>>>
>>> No, just put them on a separate line.
>>>
>>> I'll have another look at the new line trimming algorthim to see if I
>>> can make it more friendly with respect to comments. No promises for this
>>> release, so it still comes down to, put your comments on a separate
>>> line.
>>>
>>> <%-- Good: do something --%>
>>> <c:iterate ... >
>>>
>>> <c:iterate ...> <%-- Bad: will result in a an unexpected new line --%>
>>>
>>> Paul
>>>
>>> "Stu" <evaandoli@dodo.com.au> wrote in message
>>> news:eugl88$70b$1@build.eclipse.org...
>>>>I get the same thing and yes I have comments all over the place trying
>>>>to make the text understandable.
>>>>
>>>> Are you saying to remove these ghost blank lines you have to remove all
>>>> comments ? Seems a shame.
>>>>
>>>>
>>>>
>>>> "Paul Elder" <pelder@ca.ibm.com> wrote in message
>>>> news:eugbj7$qk8$1@build.eclipse.org...
>>>>> John:
>>>>>
>>>>> JET2 removes write space when a tag (or other language element) is
>>>>> alone on a line.
>>>>>
>>>>> Rule of thumb: If you don't want write space associated with a tag,
>>>>> put it on its own line.
>>>>>
>>>>> So:
>>>>>
>>>>> <c:iterate select... >
>>>>> Some code
>>>>> </c:iterate>
>>>>>
>>>>> Should produce
>>>>>
>>>>> Some code
>>>>> Some code
>>>>> Some code
>>>>> ...
>>>>>
>>>>> But, if you put a comment on the line
>>>>>
>>>>> <c:iterate select... > <%-- a comment --%>
>>>>> Some code
>>>>> </c:iterate>
>>>>>
>>>>> You'd get:
>>>>>
>>>>> Some code
>>>>>
>>>>> Some code
>>>>>
>>>>> Some code
>>>>>
>>>>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>>>>> news:euelal$d3e$1@build.eclipse.org...
>>>>>> John,
>>>>>>
>>>>>> Please use the M2T newsgroup for JET2 questions. I've added it to
>>>>>> the "to" list so Paul should see your question. He might need more
>>>>>> detail though. Often the goodness of the answer is proportional to
>>>>>> the amount of information provided in the question...
>>>>>>
>>>>>>
>>>>>> John Slave wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> i am using emft jet generation to create java code however i cannot
>>>>>>> find how to remove whitespaces (these whitespaces are that from used
>>>>>>> tags).
>>>>>>>
>>>>>>> Thanks in advance
>>>>>>> Tobia Loschiavo
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>
Re: Remove whitespaces from generation [message #11601 is a reply to message #11416] Fri, 13 April 2007 12:17 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Stu:

Thanks for you persistence. I have filed bug 182311
(https://bugs.eclipse.org/bugs/show_bug.cgi?id=182311). I'll be fixed
shortly.

Paul
"Stu" <evaandoli@dodo.com.au> wrote in message
news:evkdkp$952$1@build.eclipse.org...
> Ok I got around to finding my problem with a blank line appearing when I
> think it shouldnt.
>
> Here is the line that caused trouble:-
>
> PreText1
> <c:addTextElement select="$conductorType/valueHolder" name="notFoundName"
> var="notFound">NotFound</c:addTextElement>
>
> PostText1
>
> Output looks like:
> PreText1
>
> PostText1
>
> I tried:-
> <c:addTextElement select="$conductorType/valueHolder" name="notFoundName"
> var="notFound">
> NotFound
> </c:addTextElement>
>
> but got the same result.
>
> Stuart
>
Previous Topic:Questions about XSD transformation
Next Topic:Jet directive not found
Goto Forum:
  


Current Time: Wed Nov 26 09:31:52 GMT 2014

Powered by FUDForum. Page generated in 0.02168 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software