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 12:29 Go to next message
Eclipse User
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 11:10 Go to previous message
Paul Elder is currently offline Paul Elder
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: Wed Aug 20 03:02:51 EDT 2014

Powered by FUDForum. Page generated in 0.03883 seconds