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-SOSWA
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 Dietrich
Messages: 6327
Registered: July 2009
Senior Member
Hi,

something like

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


doesnt work?
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-SOSWA
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 Thoms
Messages: 354
Registered: July 2009
Location: Dortmund
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, Xpand, EMF?
Go to: http://xtext.itemis.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-SOSWA
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 Sep 30 13:56:58 GMT 2014

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

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