XSL Sort Problem

Thread: XSL Sort Problem

1. Member
Join Date
Dec 1969
Posts
55

XSL Sort Problem

Hi. I am trying to sort an XML document of products, in which each product has a price. The problem I am having is with the XSL sort I am using. For instance, if I have this:<BR><BR>...<BR>&#060;PRODUCT&#062;Whatever&#0 60;/PRODUCT&#062;<BR>&#060;PRICE&#062;10.99&#060;/PRICE&#062;<BR>...<BR>&#060;PRODUCT&#062;Whatever& #060;/PRODUCT&#062;<BR>&#060;PRICE&#062;12.99&#060;/PRICE&#062;<BR>...<BR>&#060;PRODUCT&#062;Whatever& #060;/PRODUCT&#062;<BR>&#060;PRICE&#062;2.99&#060;/PRICE&#062;<BR><BR><BR>If I then try to sort it by the price, it will come back in the order of:<BR><BR>10.99<BR>12.99<BR>2.99<BR><BR>since 1 is less than 2 (as in the 1 in 10.99 is less than the 2 in 2.99). Now, we all know that 2.99 is less than 10.99. I have tried a lot of things to get this to work, any suggestions?<BR><BR>Chris<BR>

2. Senior Member
Join Date
Dec 1969
Posts
760

RE: XSL Sort Problem

By default, the sort is alpha, to get it to sort by numeric values, you&#039ll need to use the datatypes namespace.<BR><BR>Several links<BR><BR><BR>http://search.microsoft.com/us/dev/default.asp?qu=datatypes+namespace&btnSubmit=+Sear ch+&boolean=ALL&nq=NEW&so=RECCNT&p=1&chkM=on&radM= 2&chkS=on&radS=2&chkA=on&radA=2&chkP=on&radP=2&chk K=on

3. Member
Join Date
Dec 1969
Posts
55

RE: XSL Sort Problem

Thanks Andrew, I checked out the articles and got it to work. I appreciate it.<BR><BR>Chris

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•