Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Nov 2005 11:37:21 -0800 (PST)
From:      "Devon H. O'Dell" <dodell@skik.dtrace.internal.sitetronics.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   www/88809: Commercial vendor listings are sorted on in character value format
Message-ID:  <200511101937.jAAJbL0f052692@skik.dtrace.internal.sitetronics.com>
Resent-Message-ID: <200511101940.jAAJeEIK082933@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200511101937.jAAJbL0f052692>