Skip to main content

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 UserFriend
Originally posted by:


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" ?>
<section value="1">
<section value="1.1">
<section value="1.1.1"/>
<section value="1.1.2"/>
<section value="1.2">
<section value="1.2.1"/>
<section value="1.2.2"/>
<section value="2">
<section value="2.1">
<section value="2.1.1"/>
<section value="2.1.2"/>

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

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 ?
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 UserFriend
Originally posted by:

Ok, I've used the workaround described in previous post :
[Jet : define recursive fonction.] 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 Friend
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:Using AND in a test
Next Topic:Multiple Files
Goto Forum:

Current Time: Sun May 27 05:32:27 GMT 2018

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

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

Back to the top