www/88809: Commercial vendor listings are sorted on in character value format

Devon H. O'Dell dodell at skik.dtrace.internal.sitetronics.com
Thu Nov 10 11:40:16 PST 2005


>Number:         88809
>Category:       www
>Synopsis:       Commercial vendor listings are sorted on in character value format
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-www
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 10 19:40:14 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Devon H. O'Dell
>Release:        FreeBSD 7.0-CURRENT amd64
>Organization:
iXsystems
>Environment:
System: FreeBSD skik.dtrace.internal.sitetronics.com 7.0-CURRENT FreeBSD 7.0-CURRENT #23: Mon Nov 7 11:24:03 PST 2005 dodell at skik.dtrace.internal.sitetronics.com:/usr/obj/usr/src/sys/SKIK amd64


	
>Description:
	Commercial vendor listings are sorted in the order of the ASCII
	character code, which is how xsl:sort works. This is unfair to
	vendors across the board whose names start with a lowercase
	letter, and are therefore sorted towards the bottom. This patch
	fixes the issue by using the translate() function to return an
	all lowercase value for the contents of the name tag.
>How-To-Repeat:
	Visit any of the commercial vendor pages at
	http://www.freebsd.org/commercial/
>Fix:

--- xsl_sort_insensitive.diff begins here ---
Index: entries.xsl
===================================================================
RCS file: /home/dodell/cvs/www_cvs/www/en/commercial/entries.xsl,v
retrieving revision 1.5
diff -u -r1.5 entries.xsl
--- entries.xsl	4 Oct 2005 16:33:22 -0000	1.5
+++ entries.xsl	10 Nov 2005 19:02:42 -0000
@@ -40,6 +40,8 @@
   </xsl:variable>
   <xsl:variable name="email" select="'freebsd-www'"/>
   <xsl:variable name="title" select="'Commercial Vendors'"/>
+  <xsl:variable name="upperCase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
+  <xsl:variable name="lowerCase" select="'abcdefghijklmnopqrstuvwxyz'"/>
   <xsl:param name="pagename" select="''"/>
 
   <xsl:output method="xml" encoding="iso-8859-1"
@@ -82,7 +84,7 @@
 	<h2><xsl:value-of select="$pagename"/></h2>
 
 	<xsl:for-each select="entry">
-	  <xsl:sort select="name" order="ascending"/>
+	  <xsl:sort select="translate(./name, $upperCase, $lowerCase)" order="ascending"/>
 	  <a name="{@id}" href="{url}">
 	    <xsl:value-of select="name"/>
 	  </a><br/>
--- xsl_sort_insensitive.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-www mailing list