Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » JET tag to set local variable - Flag
JET tag to set local variable - Flag [message #51950] Tue, 07 October 2008 13:32 Go to next message
justin Mising name is currently offline justin Mising nameFriend
Messages: 28
Registered: July 2009
Junior Member
Hi,
I need to set a local variable - like boolean flag in my template file for
a business logic condition that should occur only the first time .(flag
before iteration begins) .
I did not find JET tag to set local variable. c:set tag sets XPath
expression only.
Part of snippet is below:
<c:setVariable select="$oldSpringContext/beans" var="beanRoot"/>
<c:iterate select="$currentArtifact/package" var="currentPackage">
<c:iterate select="$currentPackage/class" var="currentClass">
Pls let me know if JET tag exists or workaround.
Regards,
Justin.
Re: JET tag to set local variable - Flag [message #51976 is a reply to message #51950] Wed, 08 October 2008 16:41 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Justin:

Boolean, string and numeric expressions are also valid XPath expressions.

So:

<c:setVariable var="firstTime" select="true()"/>
<c:iterate ... >
<c:if test="$firstTime">
<c:setVariable var="firstTime" select="false()"/>
... first time processing...
</c:if>
</c:iterate>

FYI. You can also do:

<c:setVarible var="i" select=" 1 "/> <%-- $i equals the number 1 --%>

or

<c:setVariable var="ECLIPSE" select=" 'org.eclipse' "/> <%-- $ECLIPSE
equals the string 'org.eclipse' (without the quotes) --%>

Paul
Previous Topic:Problems with java:package
Next Topic:Re: Using JET with EMF model
Goto Forum:
  


Current Time: Thu Dec 26 12:55:14 GMT 2024

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

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

Back to the top