Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » How to set the transformation output file path?
How to set the transformation output file path? [message #47554] Thu, 10 July 2008 15:17 Go to next message
Eclipse UserFriend
Originally posted by: georges.bachelier.atmel.com

Hello everyone,

I would like my JET transformation output file name to be based on some
variables values.

The current JET code is:

<ws:file template="templates/flow_template.jet"
path="{$org.eclipse.jet.resource.project.name}/flow.xml"/>

I have changed it to:

<ws:file template="templates/flow_template.jet"
path="{$org.eclipse.jet.resource.project.name}/"/><c:get
select="/Flow/@flowName"/>"."<c:get select="/Flow/@flowCategory"/>".xml"/>

where Flow is an Ecore element with flowName and flowCategory attributes.

I would like the output file name to be
<flowName_value>.<flowCategory_value>.xml

When I run my transformation, I get the following error message:
org.eclipse.jet.taglib.JET2TagException: Path must include project and
resource name: /FlowEditor/

Could you please help me to fix this?

Thanks a lot in advance for your time,

Georges
Re: How to set the transformation output file path? [message #47587 is a reply to message #47554] Fri, 11 July 2008 11:51 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Georges:


You wrote:
> I would like the output file name to be
> <flowName_value>.<flowCategory_value>.xml

Try:

<ws:file template="templates/flow_template.jet"
path=" {$org.eclipse.jet.resource.project.name}/{/Flow/@flowName}.{ /Flow/@flowCategory}.xml "/>


In general, any JET tag's attribute value can be composed of multiple
'dynamic XPath' expressions between { and }. So, the above ws:file tag has
three expressions in the path attribute:
* $org.eclipse.jet.resource.project.name gives name of the project of the
input model
* /Flow/@flowName and /Flow/@flowCategory give components of the file
name.

Paul
Previous Topic:Xpand Ganymede Roadmap
Next Topic:iteration over an iterable object not a select
Goto Forum:
  


Current Time: Fri Apr 19 14:22:52 GMT 2024

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

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

Back to the top