This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: sorting and grouping - can't get it to work


> Now for my question
>
> I have a little problem with data I want to sort and then place into a
> two-column table
> (two of the sorted data items in each row).
>
>
> <xsl:template match="data/item">
>     <table>
>         <xsl:for-each select="item[position() mod 2 = 1]">

Someone has already pointed out that your item elements don't occur as
children of a data/item.
>
> But what I really need is that the sorting of the item takes
> place before I
> start selecting some of them to start rows.
>
For a problem that involves sorting, then grouping, I recommend a two-phase
approach. Build a result tree fragment that contains the data in sorted
order, use the xx:node-set() extension function to convert this to a
node-set, and do the grouping in a second pass over this node-set.

Mike Kay
Software AG


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]