Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET] How to do like <c:dump select="var"/> but to a variable/string instead?(DOM subtree dump to string/variable)
[JET] How to do like <c:dump select="var"/> but to a variable/string instead? [message #522452] Mon, 22 March 2010 16:55 Go to next message
Shaman_Mahmoudi  is currently offline Shaman_Mahmoudi Friend
Messages: 16
Registered: February 2010
Junior Member
Hi,

I am serializing several elements of type 'X' to their own separate files, and in that process I am also serializing common elements for all files. What I would like to do is to save the dom subtree of the common elements to a string or variables so I do not need to parse through the parent element for each file I am creating.

I am doing this for each file right now which is inefficient.:

<c:iterate select="$elements/../*[not(local-name() = 'X')]" var="element">
<c:dump select="$element"/>
</c:iterate>


I would like to do a similiar thing like the above code and save/serialize it to a string-variable or a list of variables (is this even possible?) instead of dumping/serializing to file.
Re: [JET] How to do like <c:dump select="var"/> but to a variable/string instead? [message #522700 is a reply to message #522452] Tue, 23 March 2010 16:22 Go to previous message
Shaman_Mahmoudi  is currently offline Shaman_Mahmoudi Friend
Messages: 16
Registered: February 2010
Junior Member
I found a way:

main.jet

<c:setVariable select="/elements/*[not(local-name() = 'X')]" var="modelelements"/>


dump.jet

<c:iterate select="$modelelements" var="element">
<c:dump select="$element"/>
</c:iterate>


A little better.
Previous Topic:[XTEND]Iteration over a list
Next Topic:SQL Beautifier ??
Goto Forum:
  


Current Time: Fri Apr 26 19:21:57 GMT 2024

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

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

Back to the top