Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » escape chrachter in Xpand
escape chrachter in Xpand [message #975264] Wed, 07 November 2012 18:49 Go to next message
Adnan AL-SOSWA is currently offline Adnan AL-SOSWAFriend
Messages: 41
Registered: May 2010
Member
Hello all ,

I want to generate Xpand template using Xpand itself. I have to escape all the Xpand keywords .
Is there any escape character for Xpand?or any alternative way to do that?

thanks in Advance .
Re: escape chrachter in Xpand [message #975416 is a reply to message #975264] Wed, 07 November 2012 21:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

something like

«FILE "test.xpt"»
«"«DEFINE test FOR Model»"»
«"«ENDDEFINE»"»
«ENDFILE»


doesnt work?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: escape chrachter in Xpand [message #975998 is a reply to message #975416] Thu, 08 November 2012 08:31 Go to previous messageGo to next message
Adnan AL-SOSWA is currently offline Adnan AL-SOSWAFriend
Messages: 41
Registered: May 2010
Member
Hi Christian

Thank you for reply , I tried your solution , but the generated file did not recognize
french guillemets « » the result was like this .
�IMPORT Usecase�


�EXPAND autoname FOREACH name�
�DEFINE autoname FOR name�

any sugestions please?


thank you very much
Re: escape chrachter in Xpand [message #976298 is a reply to message #975264] Thu, 08 November 2012 13:22 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

This is an encoding issue. Set the output encoding to the one used for your templates. Consider to set the resource encoding for your project to project specific setting. Usual values for encoding are UTF-8 or ISO-8859-1.

	<component class="org.eclipse.xpand2.Generator">
...
		<outlet path="${src-gen}" fileEncoding="UTF-8">
			<postprocessor class="org.eclipse.xpand2.output.JavaBeautifier" />
		</outlet>
	</component>


Regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: escape chrachter in Xpand [message #976413 is a reply to message #976298] Thu, 08 November 2012 15:07 Go to previous message
Adnan AL-SOSWA is currently offline Adnan AL-SOSWAFriend
Messages: 41
Registered: May 2010
Member
Thanks Karsten ,
now it works fine .
Previous Topic:From OWL 2 metamodel to any abstract syntax
Next Topic:[Acceleo] Problem invoke java service
Goto Forum:
  


Current Time: Tue Apr 16 19:21:49 GMT 2024

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

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

Back to the top