Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET2] <c:iterate> tag bahavior
[JET2] <c:iterate> tag bahavior [message #17181] Wed, 23 May 2007 15:59 Go to next message
Eclipse User
Originally posted by: vincent.lg.voila.fr

Hi,

I was implementing a custom iterating tag (with sorting feature) and
realized the <c:iterate> tag has not the behavior one might expect. Please
see the simple example below :

An xml file to be transformed :
<?xml version="1.0" ?>
<root>
<book>
<section value="1">
<section value="1.1">
<section value="1.1.1"/>
<section value="1.1.2"/>
</section>
<section value="1.2">
<section value="1.2.1"/>
<section value="1.2.2"/>
</section>
</section>
<section value="2">
<section value="2.1">
<section value="2.1.1"/>
<section value="2.1.2"/>
</section>
</section>
</book>
</root>

The jet template :
<c:iterate select="//book//section" var="sec">
section <c:get select="$sec/@value"/>
</c:iterate>

and the output :
section 1
section 2
section 1.1
section 1.2
section 1.1.1
section 1.1.2
section 1.2.1
section 1.2.2
section 2.1
section 2.1.1
section 2.1.2

As one can see, the output is a bit strange, as I was expecting the output
to be in the same order as in the xml input file.
AFAIK, the xpath tag <xsl:for-each> would have printed the good result, no
?

Is there a way to use the iterate tag to print nodes in the correct order ?
Thanks.
Re: [JET2] <c:iterate> tag bahavior [message #17212 is a reply to message #17181] Wed, 23 May 2007 16:24 Go to previous messageGo to next message
Eclipse User
Originally posted by: vincent.lg.voila.fr

Ok, I've used the workaround described in previous post :
[Jet : define recursive fonction.]
http://www.eclipse.org/newsportal/article.php?id=191&gro up=eclipse.modeling.m2t#191

and it works fine for the moment. bye
Re: [JET2] <c:iterate> tag bahavior [message #515436 is a reply to message #17212] Thu, 18 February 2010 18:48 Go to previous message
Samira  is currently offline Samira
Messages: 10
Registered: November 2009
Junior Member
I can't see the solution on the link, only the problem definition,

would you please post it here..

thanks Smile
Previous Topic:[Acceleo] Generators interface ?
Next Topic:extending Xpand models
Goto Forum:
  


Current Time: Wed Sep 24 00:25:58 GMT 2014

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

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