Skip to main content



      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 12:41 Go to next message
Eclipse UserFriend
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 13:03 Go to previous messageGo to next message
Eclipse UserFriend
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 16:46 Go to previous messageGo to next message
Eclipse UserFriend
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 19:55] by Moderator

Re: [Acceleo] Getting object's textual reference [message #1767242 is a reply to message #1767229] Tue, 04 July 2017 03:01 Go to previous messageGo to next message
Eclipse UserFriend
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 04:40 Go to previous message
Eclipse UserFriend
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: Mon May 12 02:26:44 EDT 2025

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

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

Back to the top