Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » EMF iterate through an Enumeration's fields
EMF iterate through an Enumeration's fields [message #32408] Wed, 05 September 2007 10:06 Go to next message
Tex Twil is currently offline Tex TwilFriend
Messages: 179
Registered: July 2009
Senior Member
Hi,
It's been a while since my last post and now I got back to using JET and I
already have a question.

I use JET for a EMF model transformation and I'd like to know how can I get
all the "fields" of a Enumaration which I have in my ecore.

Thanks
Kind regards,
Tex
Re: EMF iterate through an Enumeration's fields [message #32721 is a reply to message #32408] Thu, 06 September 2007 12:19 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Tex:

In an ecore model Enumerations are declared as EAttributes, so, you would do
$parentVar/@enumAttrName. It should return you the symbolic value of the
enumeration. There isn't a way to get at the numeric value without dropping
into Java code, or writing a custom XPath function.

Paul

"Tex Twil" <chaljan@hotmail.com> wrote in message
news:fblv2k$q7n$1@build.eclipse.org...
> Hi,
> It's been a while since my last post and now I got back to using JET and I
> already have a question.
>
> I use JET for a EMF model transformation and I'd like to know how can I
> get all the "fields" of a Enumaration which I have in my ecore.
>
> Thanks
> Kind regards,
> Tex
Re: EMF iterate through an Enumeration's fields [message #32886 is a reply to message #32721] Thu, 06 September 2007 13:06 Go to previous message
Tex Twil is currently offline Tex TwilFriend
Messages: 179
Registered: July 2009
Senior Member
Ok
but I want to list all the EEnum. Not only one reference to one of these
Enumeration. The EEnum is directly on the "root" of my model. Something
like:

<c:iterate select="/@MyColors" var="aColor">
<c:get select="$aColor" />
</c:iterate>

But anyway, I think this joins the problem that Stu and I are talking about
in the other message "[JET2] Struggling with iterate command" and also the "
EMF Iterate through an String array" :) I think those topics are similar.

Tex

"Paul Elder" <pelder@ca.ibm.com> a écrit dans le message de
news:fbor9j$et7$1@build.eclipse.org...
> Tex:
>
> In an ecore model Enumerations are declared as EAttributes, so, you would
> do $parentVar/@enumAttrName. It should return you the symbolic value of
> the enumeration. There isn't a way to get at the numeric value without
> dropping into Java code, or writing a custom XPath function.
>
> Paul
>
> "Tex Twil" <chaljan@hotmail.com> wrote in message
> news:fblv2k$q7n$1@build.eclipse.org...
>> Hi,
>> It's been a while since my last post and now I got back to using JET and
>> I already have a question.
>>
>> I use JET for a EMF model transformation and I'd like to know how can I
>> get all the "fields" of a Enumaration which I have in my ecore.
>>
>> Thanks
>> Kind regards,
>> Tex
>
>
Previous Topic:JET2 editor plugin ?
Next Topic:[JET2] Struggling with iterate command
Goto Forum:
  


Current Time: Thu Apr 25 09:22:09 GMT 2024

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

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

Back to the top