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

RE: Grooping and Sorting problem

Subject: RE: Grooping and Sorting problem
From: Frédéric Tremblay <ftremblay@xxxxxxxxxxxxxxx>
Date: Thu, 28 Mar 2002 14:58:00 -0500
frederic tremblay
Hi,

	thanks for the answer but the problem is: i want to sort all
elements
like you suggest and i want to make a table with 5 rows and n column. To do
this
i try this:


	<xsl:for-each select="test" >
    
		<xsl:sort select="@number" data-type ="number"/>    
    
		<xsl:if test="position() mod 5 = 1">
    
			<tr>
			<xsl:for-each select="self::test |
following-sibling::test[position() &lt; 5]">
				<td><xsl:apply-templates/><xsl:value-of
select="@number"/></td>
			</xsl:for-each>
			</tr>
	          
		</xsl:if>
      
	</xsl:for-each>

But the problems is the first element is sorted but the 
	following-sibling::test[position() &lt; 5]"
is not sorted... 

So how can i, first sort all element and after grooping it
to make a table with 5 rows and n column?

Thanks a lot!

Fred


-----Original Message-----
From: tanz@xxxxxxxxxxxxxxxxxxxxx [mailto:tanz@xxxxxxxxxxxxxxxxxxxxx]
Sent: Thursday, March 28, 2002 2:32 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Grooping and Sorting problem


Hi Frédéric,

To sort your elements you can use the xsl:sort element:

For example:

<xsl:for-each select="root/test">
               <xsl:sort
                   select="./@number"
                   data-type="number"
                   order="ascending"
               />
.......
</xsl:for-each>

Regards

Tanzila


----- Original Message -----
From: "Frédéric Tremblay" <ftremblay@xxxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, March 28, 2002 7:14 PM
Subject:  Grooping and Sorting problem


> > Hi, i want to make a HTML table with 5 column and n rows with a XML like
> > this:
> >
> > <root>
> > <test number="3">
> > <test number="1">
> > <test number="4">
> > <test number="2">
> > <test number="5">
> > ...
> > <test number="100">
> > </root>
> >
> > so i want to make a table with 5 column and n rows, at every 5 element
> > i want a new row.
> >
> > BUT THE PROBLEM IS: I NEED TO HAVE ALL ELEMENT SORTED!!!
> >
> > How can i do this?
> >
> > Thanks a lot!
> >
> > Fred
> >
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>
>


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

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


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.