Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Setting string to a variable
Setting string to a variable [message #41697] Mon, 11 February 2008 17:29 Go to next message
Eclipse UserFriend
Originally posted by: pankaj.surti.xxxx.com

Hi,

I use the following syntax to set the variable with string value.

<c:setVariable select="'Somevalue'" var="ctlType"/>

I do get the value correctly when I use

(context.getVariable("ctlType").toString());


My questions is:

Is this correct way to use the "select"?

Thanks,
-Pankaj.
Re: Setting string to a variable [message #41846 is a reply to message #41697] Wed, 13 February 2008 16:10 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Yes.

And, in addition to using Java code, you could use:

<c:get select="$ctlType"/>

You can also use:

<c:setVariable select=" 3 " var="someNumericVar"/>

And, for that matter, you can loop via:

<c:iterate select=" 10 " var="index">
index: <c:get select="$index"/>
</c:iterate>

Paul

"pankaj" <pankaj.surti@xxxx.com> wrote in message
news:0e815c8f13613ae88b2df9d5663e30e6$1@www.eclipse.org...
> Hi,
>
> I use the following syntax to set the variable with string value.
>
> <c:setVariable select="'Somevalue'" var="ctlType"/>
>
> I do get the value correctly when I use
> (context.getVariable("ctlType").toString());
>
>
> My questions is:
>
> Is this correct way to use the "select"?
>
> Thanks,
> -Pankaj.
>
Previous Topic:Debugging the JET in the Eclipse
Next Topic:How to test an element specified in the input xml or not?
Goto Forum:
  


Current Time: Fri Nov 28 00:46:46 GMT 2014

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

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