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 #1767218] 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 #1767253 is a reply to message #1767218] Tue, 04 July 2017 08:26 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

The reference format is not stable and will depend on EMF. They can be relative, absolute, use eKeys... You can try and get the reference URI through EcoreUtil.getURI(EObject) (you will have to use a java service to call it), but there is no guarantee you will obtain the exact format you expect.

Laurent Goubet
Obeo
Previous Topic:Artifact fileName
Next Topic:[Acceleo] Getting object's textual reference
Goto Forum:
  


Current Time: Tue Apr 23 14:37:11 GMT 2024

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

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

Back to the top