Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » c:set with xpath expression value
c:set with xpath expression value [message #43259] Sat, 15 March 2008 17:02 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
Hey,

while visiting my UML input model, I want to annotate certain elements,
here for example all "TypedElements". I do so, by just looking at every
element and applying a switch. For elements I'am not interested, my
switch returns an empty string, otherwise the name of their type.
In case the returned string is not empty, I add an attribute to the element:

<%-- Element: TypedElement; variable __type; Value: Name of the
Element's type --%>
<%TypeSwitch sw = new TypeSwitch();%>
<c:visitor select="/contents" var="_e">
<%
context.setVariable("__t",sw.doSwitch((EObject)context.getVariable( "_e")));%>
<c:visit test="$__t != ''">
<c:set select="$_e" name="__type"><c:get select="$__t"/></c:set>
</c:visit>
</c:visitor>

I am a little disturbed by the nested c:get tag:
<c:get select="$__t"/>

Wouldn't it be cool to have an extended <c:set> where one could directly
enter an xpath expression as the resulting value:

<c:set select="$_e" name="__type" value="$__type">


Felix
Re: c:set with xpath expression value [message #43286 is a reply to message #43259] Sat, 15 March 2008 17:03 Go to previous messageGo to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 676
Registered: July 2009
Senior Member
I mean:

<c:set select="$_e" name="__type" value="$__t">
Re: c:set with xpath expression value [message #43704 is a reply to message #43286] Wed, 26 March 2008 14:19 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Felix:

Please submit an enhancement request - it is by far the best way to remind
me that something needs done:

https://bugs.eclipse.org/bugs/enter_bug.cgi?product=M2T& version=unspecified&component=Jet&rep_platform=PC&am p;op_sys=Windows%20XP&priority=P3&bug_severity=enhan cement&bug_status=NEW&bug_file_loc=http%3A%2F%2F& ;short_desc=&comment=&commentprivacy=0&keywords= &dependson=&blocked=&maketemplate=Remember%20val ues%20as%20bookmarkable%20template&form_name=enter_bug&a mp;assigned_to=m2t.jet-inbox%40eclipse.org

Paul

"Felix Dorner" <felix_do@web.de> wrote in message
news:frgvhn$cq2$2@build.eclipse.org...
>I mean:
>
> <c:set select="$_e" name="__type" value="$__t">
Previous Topic:UserRegion Does not work... Please help
Next Topic:import statement from userRegion are disappearing
Goto Forum:
  


Current Time: Thu Apr 25 22:00:58 GMT 2024

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

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

Back to the top