Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] Getting object's textual reference(Get textual reference)
[Acceleo] Getting object's textual reference [message #1767217] Mon, 03 July 2017 16:41 Go to next message
Cesar Bernabe is currently offline Cesar BernabeFriend
Messages: 13
Registered: December 2016
Junior Member
Hey,

I'm creating a Ecore to (a customized) XML file conversor using Acceleo. However, some references in my XML file need to maintain the same kind of reference text which is in the Ecore file.

For example, I have a ecore file as follows:
<refinements xsi:type="gore:AwReq" name="A3" target="//@refinements.0">
<strategies xsi:type="eca:RelaxReplaceChildStrategy" name="'RelaxReplaceChildStrategy'" requirement="//@refinements.0" newRequirement="//@refinements.3"/>
</refinements>

I want to have the same string as in target, requirement or newRequirement variables. So my new XML file would be, for instance:
<newFormatedLine name="..." target="//@newFormatedLine.0">

But in acceleo I can only get the objects class reference, not its textual reference. Do someone can help me in this (apparently) simple task?

Thanks.
Re: [Acceleo] Getting object's textual reference [message #1767221 is a reply to message #1767217] Mon, 03 July 2017 17:03 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Acceleo is an M2T tool. The references are part of the M serialization of an object reference. If you need those in your output perhaps you should be using an M2M tool. But if you really want them you can use an Acceleo invoke to access routines such as EcoreUtil.getURI, and URI.resolve.

Regards

Ed Willink
Re: [Acceleo] Getting object's textual reference [message #1767229 is a reply to message #1767221] Mon, 03 July 2017 20:46 Go to previous messageGo to next message
Cesar Bernabe is currently offline Cesar BernabeFriend
Messages: 13
Registered: December 2016
Junior Member
Hi Ed, thanks for helping!

Actually, I noticed that the reference in the generated file has to be based on the lines of that new file. So now I have no clue on how I can do this, do you have any ideia?

Tnks,

[Updated on: Mon, 03 July 2017 23:55]

Report message to a moderator

Re: [Acceleo] Getting object's textual reference [message #1767242 is a reply to message #1767229] Tue, 04 July 2017 07:01 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

As I wrote before, it looks like you are dealing with a model rather than text and so should use an M2M tool.

Regards

Ed Willink
Re: [Acceleo] Getting object's textual reference [message #1767256 is a reply to message #1767242] Tue, 04 July 2017 08:40 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

Didn't realize you had double-posted. My answer can be found on your other post but as Ed suggests, you might want to look into using a proper model-to-model tool instead of model-to-text such as Acceleo.

Laurent Goubet
Obeo
Previous Topic:[Acceleo] Getting object's textual reference
Next Topic:[Acceleo] Use Ecore metamodel in the Acceleo editor without installing a plugin
Goto Forum:
  


Current Time: Thu Mar 28 18:16:24 GMT 2024

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

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

Back to the top