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

RE: populating table with sorted elements

Subject: RE: populating table with sorted elements
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Sun, 30 Jul 2006 09:19:26 +0100
populating table
I think this requires two passes: first sorting, then grouping. So it should
be no problem if you are using XSLT 2.0, or XSLT 1.0 with the node-set()
extension. With plain XSLT 1.0 it may be difficult to achieve in a single
pass.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: Christian Marc Schmidt [mailto:christianmarc@xxxxxxxxx] 
> Sent: 29 July 2006 15:43
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  populating table with sorted elements
> 
> I am a newcomer to XML/XSLT and am struggling with a bit of 
> code in which I am attempting to populate a six-column table, 
> while allowing an xsl:sort.
> 
> Here is a section of my current code:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
> ...
> 
> <table width="970" border="0" cellspacing="0" cellpadding="0">
>     <xsl:for-each select="xml/work/*[position() mod 6 = 1]">
>         <tr>
>             <xsl:apply-templates
> select=".|following-sibling::*[position() &lt; 6]" />
>         </tr>
>     </xsl:for-each>
> </table>
> 
> ...
> 
> The XML structure I've set up looks like this:
> 
> <xml>
>     <work>
>         <piece>
>         </piece>
>          <piece>
>         </piece>
>         ...
>     </work>
> </xml>
> 
> How would I go about adding sort functionality? It seems like 
> it would be easy enough, yet all of my attempts so far have failed...
> 
> Any suggestions would be much appreciated!
> 
> 
> Christian

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.