Number() sorting in XSL

Number() sorting in XSL

Post by alas.. » Tue, 14 Dec 1999 04:00:00



Hi there,

Has anyone had any success in sorting numbers in XSL by casting the
value in the "order-by" value to a number using the number()
information method. I have followed the example given in the WEB
workshop for Sorting XML as folows:

 <xsl:for-each select="/Orders/Order" order-by="number(OrderID)">

but it does not work. If I remove the number() function I successfully
get all orders sorted as text, but this is not the desired sort method.

Any help will be greatly appreciated.

P.S. I am nit using a schema.

Thanks

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Number() sorting in XSL

Post by alas.. » Wed, 15 Dec 1999 04:00:00




> Hi there,

> Has anyone had any success in sorting numbers in XSL by casting the
> value in the "order-by" value to a number using the number()
> information method. I have followed the example given in the WEB
> workshop for Sorting XML as folows:

>  <xsl:for-each select="/Orders/Order" order-by="number(OrderID)">

> but it does not work. If I remove the number() function I successfully
> get all orders sorted as text, but this is not the desired sort
method.

> Any help will be greatly appreciated.

> P.S. I am not using a schema.

> Thanks

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Hi there,

I have done more tests that revealed the following:

1. Cutting down the amount of data that is being sorted significantly
resulted in the sort on one column working perfectly.

<xsl:for-each select="/Orders/Order" order-by="number(OrderID)">

2. Adding a second sort field as in:
<xsl:for-each select="/Orders/Order" order-by="number(OrderID);number
(LineNum)">
Messes up the sort again.

Conclusion:

It seems that there is a bug/limitation that prevents the technology
from working beyond a certain size of data. This also depends on the
number of sort fields as the more sort fields the more working buffer
is required.

Does this make sense to anyone?
Has anyone encountered the same problems.

Thanks
Naamat Al-Aswad

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. XSL/XPATH and sorting abs(number)

I noticed that XPATH has a floor,ceiling,round and sum functions but
no absolute function for numbers. How can I sort nodes by using
absolute values???

For example, I would like to do the following

order="descending"/>

I could put the absolute number into the XML data, but I thought there
should be an easier way/XSL-XPath way.

Thanks
Rich

2. global pulse and os 3.3 ?!

3. Sorting Numbers using XSL.

4. Shadows, shadows...

5. xsl:sort when mix of numbers and null values

6. zzudwrite

7. Newbie xsl:sort and numbering question

8. how do I define 1 menu, fonts etc.. for an entire web app.

9. xsl:sort problems with large number

10. How do i sort a list of numbers using XSL

11. XSL Sorting of Large Amounts of Data using the number() method

12. setting xsl:number to start numbers with 0 ?

13. Can I call xsl:number() from diff templates and output continous number