Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » is it possible to SORT the results of a jet xpath select ?
is it possible to SORT the results of a jet xpath select ? [message #43345] Mon, 17 March 2008 13:05 Go to next message
Edoardo Comar is currently offline Edoardo ComarFriend
Messages: 102
Registered: July 2009
Senior Member
In my template I iterate over a set of elements
<c:iterate select="$currFile/foo/bar/element" var="element">

It lately turned out that these elements may not be in the oder I need
for processing, I'd need them sorted by the value of an attribute.

I'd be happy if the select statement supported "some sort" ;-) of
sorting syntax.
alternatively, could the template sort the dom first and then start the
iteration?

cheers
Edo
Re: is it possible to SORT the results of a jet xpath select ? [message #43735 is a reply to message #43345] Wed, 26 March 2008 14:23 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Edoardo:

There are no out-of-the box functions to sort. A function sort function may
be in order. Something like:

<c:iterate select="sort( my XPath, a-sort-key-expression)" var="...">

could be useful.

It is certainly possible for you to create something like this yourself, but
it would also be useful to the community at large.

Why not start by creating an enhancement bugzilla, and we can
discuss/develop an appropriate solution that will eventually land back in
JET?

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


"Edoardo Comar" <ecomar@uk.ibm.com> wrote in message
news:frlqau$24a$1@build.eclipse.org...
> In my template I iterate over a set of elements
> <c:iterate select="$currFile/foo/bar/element" var="element">
>
> It lately turned out that these elements may not be in the oder I need for
> processing, I'd need them sorted by the value of an attribute.
>
> I'd be happy if the select statement supported "some sort" ;-) of sorting
> syntax.
> alternatively, could the template sort the dom first and then start the
> iteration?
>
> cheers
> Edo
Re: is it possible to SORT the results of a jet xpath select ? [message #43920 is a reply to message #43735] Thu, 27 March 2008 11:03 Go to previous message
Edoardo Comar is currently offline Edoardo ComarFriend
Messages: 102
Registered: July 2009
Senior Member
done!
https://bugs.eclipse.org/bugs/show_bug.cgi?id=224337

Paul Elder wrote:
> Edoardo:
>
> There are no out-of-the box functions to sort. A function sort function may
> be in order. Something like:
>
> <c:iterate select="sort( my XPath, a-sort-key-expression)" var="...">
>
> could be useful.
>
> It is certainly possible for you to create something like this yourself, but
> it would also be useful to the community at large.
>
> Why not start by creating an enhancement bugzilla, and we can
> discuss/develop an appropriate solution that will eventually land back in
> JET?
>
> 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
>
>
> "Edoardo Comar" <ecomar@uk.ibm.com> wrote in message
> news:frlqau$24a$1@build.eclipse.org...
>> In my template I iterate over a set of elements
>> <c:iterate select="$currFile/foo/bar/element" var="element">
>>
>> It lately turned out that these elements may not be in the oder I need for
>> processing, I'd need them sorted by the value of an attribute.
>>
>> I'd be happy if the select statement supported "some sort" ;-) of sorting
>> syntax.
>> alternatively, could the template sort the dom first and then start the
>> iteration?
>>
>> cheers
>> Edo
>
>
Previous Topic:Editor not marking unresolved types?
Next Topic:problem with 0.9.0 I200804162020
Goto Forum:
  


Current Time: Sun Nov 23 05:07:06 GMT 2014

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

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