Skip to main content



      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 12:55 Go to next message
Eclipse UserFriend
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 12:22 Go to previous message
Eclipse UserFriend
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: Sat Jul 12 22:38:43 EDT 2025

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

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

Back to the top