Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Strange behaviour on generating text - Indentations do not match
Strange behaviour on generating text - Indentations do not match [message #1798688] Thu, 22 November 2018 17:45 Go to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hello,

I am facing an strange behaviour when generating my xml file with Acceleo. Some times it inserts more indentation than what I have set and sometimes it is working fine. It is weird to me because if the indentation is set, then it should be there always and not sometimes. I have check all over my code and the indentation looks to be good (as I said it works sometimes). Has anyone ever faced such issue? Is there anything else that I should take into the account?

Thanks,
Parsa

[Updated on: Thu, 22 November 2018 20:30]

Report message to a moderator

Re: Strange behaviour on generating text - Indentations do not match [message #1798691 is a reply to message #1798688] Thu, 22 November 2018 21:11 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7680
Registered: July 2009
Senior Member
Hi

Yes. If you read the Acceleo documentation carefully it recommends using a pretty printing post processor if you really care about whitespace precision

Regards

Ed Willink
Re: Strange behaviour on generating text - Indentations do not match [message #1798752 is a reply to message #1798691] Fri, 23 November 2018 14:34 Go to previous messageGo to next message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
Hi Ed,

Yes, I read about post treatments but I thought maybe there is something wrong with my code! I guess I should work with some functions like replaceAll or so to come up with a solution for it then.

I have the following template:
[template public generateClassTag(clazz : information::Class) ? (hasSuperClass(clazz))]
generateClassWithSuperClassTag
someothertext
[/template]


The strange thing is that it generates the "generateClassWithSuperClassTag" text without any indentation in the line, but for the next line it generates indentation before the "someothertext". So, the result is something like:
generateClassWithSuperClassTag
			someothertext


Tried ['\n'/] instead of Enter line break and still the same result.

Thanks :)
Parsa

[Updated on: Fri, 23 November 2018 16:42]

Report message to a moderator

Re: Strange behaviour on generating text - Indentations do not match [message #1798869 is a reply to message #1798752] Mon, 26 November 2018 20:10 Go to previous message
Parsa Pourali is currently offline Parsa PouraliFriend
Messages: 210
Registered: February 2014
Senior Member
just an update, it does work when I put everything in one module in one mtl file. But if I divide the text into different modules in different mtl file, then the indentation will be messed up!
Previous Topic:[Acceleo] Java service wrapper problem/reflection
Next Topic:Unresolved compilation error, expression was null.
Goto Forum:
  


Current Time: Mon Dec 09 02:09:43 GMT 2024

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

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

Back to the top