Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » how to implement the for instruction
how to implement the for instruction [message #1027605] Wed, 27 March 2013 07:07 Go to next message
samar sousou is currently offline samar sousouFriend
Messages: 63
Registered: March 2013
Member
Hi ,
I am looking for how implement a for loop in atl transformation.
I need an exemple.
Re: how to implement the for instruction [message #1027648 is a reply to message #1027605] Wed, 27 March 2013 08:16 Go to previous messageGo to next message
Federico Toledo is currently offline Federico ToledoFriend
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
Hi, you have what you need in the manual

http://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language#The_for_statement

kind regards
Re: how to implement the for instruction [message #1027655 is a reply to message #1027648] Wed, 27 March 2013 08:30 Go to previous messageGo to next message
samar sousou is currently offline samar sousouFriend
Messages: 63
Registered: March 2013
Member
But how to emplement it in the code ATL, where and how! in rules or in helpers!! because there is an error when i implement it.
Re: how to implement the for instruction [message #1027675 is a reply to message #1027655] Wed, 27 March 2013 09:03 Go to previous messageGo to next message
Federico Toledo is currently offline Federico ToledoFriend
Messages: 97
Registered: April 2012
Location: Ciudad Real, Spain
Member
here http://www.eclipse.org/atl/ you have a section with basic examples, and another very useful called "ATL transformations Zoo". Check them out

otherwise, share your error here
Re: how to implement the for instruction [message #1027900 is a reply to message #1027675] Wed, 27 March 2013 15:12 Go to previous message
samar sousou is currently offline samar sousouFriend
Messages: 63
Registered: March 2013
Member
hi,
can I do like this!!

helper context XML!Element def: getStringValue(m : String) : Sequence(XML!Element) =
XML!Element.allInstances() -> select (p |
p.oclIsTypeOf(XML!Element) and p.name='a'and p.getStringAttrValue('name')= m )->asSequence();

helper context XML!Element def: getText(m : String) : String =
for(p in Xml!Element.getStringValue(m)) {
if not(p->isUndefined())
p.getStringDataValue()
else
''
endif
};



but as a response i have empty attribute

[Updated on: Wed, 27 March 2013 15:20]

Report message to a moderator

Previous Topic:XML2metamodel exemple
Next Topic:Can my idea work?
Goto Forum:
  


Current Time: Wed Apr 24 19:00:55 GMT 2024

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

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

Back to the top