[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Output sorted XHTML table for a subset of elements

Subject: Output sorted XHTML table for a subset of elements
From: Steven Davies <xsl-list@xxxxxxxxxxx>
Date: Sat, 24 May 2008 15:45:47 +0100
 Output sorted XHTML table for a subset of elements

I've been having a problem with a stylesheet I'm creating and need some
help with a part of it - given the following XML snippet:

  <user name="alf">
  <user name="bert">
  <user name="charlie">
  <user name="derek">

..what I'm trying to achieve is an XHTML table with 5 columns and
however many rows are necessary (imagine there may be a hundred or so
users) where the items in the table consist of only the users where the
user's line count is above 25 and is sorted by their line count.

So for the above snippet the output should be:

    <td>charlie (731)</td>
    <td>bert (78)</td>
    <td>derek (62)</td>

..obviously with more columns per row and more rows depending on the
size of the input document.

I've tried to do this using a template matching the next-siblings of the
users to achieve the grouping, but then I can't sort the items or select
the ones I want because the XPath works on the input node set and not a
node set I've selected myself (using for-each or a template).

If it makes any difference I'm using libXSLT 1.1.22 to do the

Can anyone give me any pointers with this?


Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.